better code style for ArticleGenerator::getArray

This commit is contained in:
Marcel Kapfer (mmk2410) 2016-06-06 22:22:16 +02:00
parent 17e4e5570e
commit e6245524a4

View file

@ -275,6 +275,10 @@ class ArticleGenerator
public function getArray($directory, $articlefile) public function getArray($directory, $articlefile)
{ {
$article = file_get_contents($directory . $articlefile); $article = file_get_contents($directory . $articlefile);
$title = "";
$date = "";
$author = "";
$tags = array();
if (substr($article, 0, 6) == "%TITLE") { // get and remove the title if (substr($article, 0, 6) == "%TITLE") { // get and remove the title
$title = substr($article, 8, strpos($article, "\n") - 8); $title = substr($article, 8, strpos($article, "\n") - 8);