From 1922a1a697c5ddddfb66968e631424ae6c79d52b Mon Sep 17 00:00:00 2001 From: mmk2410 Date: Sat, 22 Aug 2015 08:59:50 +0200 Subject: [PATCH] BUGFIX: Intro shown, when there's no content --- index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 2375449..746f71f 100644 --- a/index.php +++ b/index.php @@ -36,6 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Rangitaki PHP Blogging engine */ // Getting necessary php files + date_default_timezone_set('UTC'); require 'config.php'; // Config file (this must be the first line) require './lang/' . $language . ".php"; // Language file require_once 'res/php/Parsedown.php'; // The soul of the beast: Parsedown @@ -176,9 +177,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. $file = file_get_contents("blogs/$blog.md"); // get content of the blog file $file = $file . "\n"; // add a line break. necessary if the editor didn't make one while saving $file = substr($file, strpos($file, "\n")); // basically removing the first line, which contains the blog title - if ($file != "" && $file != "\n" && $file != " ") { // if the file is now neither empty nor only has a linebreak nor exists of an space + if (strlen($file) > 3) { // if there is no content, don't show the intro ?> -
+