diff --git a/index.php b/index.php index 8c2ce83..d8286d3 100644 --- a/index.php +++ b/index.php @@ -79,11 +79,11 @@ $pos = 0; if (str_starts_with($content, '---')) { - $pos = strpos($content, '---', 3); + $pos = strpos($content, '---', 3) + 3; } $Parsedown = new Parsedown(); $Parsedown->setBreaksEnabled(true); - echo $Parsedown->text('# ' . $title . "\r\n" . substr($content, $pos + 3)); + echo $Parsedown->text('# ' . $title . "\r\n" . substr($content, $pos)); $nextpage = ''; } else if (isset($_GET['open'])) @@ -165,7 +165,7 @@ $name = basename($path); if (!str_ends_with($name, '.del')) { - if (isset($_GET['search']) || isset($_GET['tags'])) + if ($_GET['param'] && (isset($_GET['search']) || isset($_GET['tags']))) { $content = file_get_contents($path); @@ -176,7 +176,7 @@ } } echo '
' . $name .''; - if (isset($_GET['tags'])) + if (isset($content) && isset($_GET['tags'])) { $tags = array(); $hastags = preg_match_all('/tags:(.*)/i', $content, $tags, PREG_SET_ORDER);