diff --git a/note.php b/note.php index de79d5e..5b7e362 100644 --- a/note.php +++ b/note.php @@ -48,7 +48,7 @@ // main $title = ''; - $content = ''; + $content = false; if (isset($_GET['new'])) { $now = date("Y-m-d H.i.s", time()); @@ -62,6 +62,12 @@ $content = file_get_contents($dir . '/' . $title . '.md'); } + if (!$content) + { + http_response_code(404); + die(); + } + clearstatcache(); $lastchanged = filemtime($dir . '/' . $title . '.md'); $lines = substr_count($content, "\r\n");