diff --git a/common.php b/common.php index b8c41b1..9eede57 100644 --- a/common.php +++ b/common.php @@ -21,10 +21,6 @@ { $zip->addFile($path, basename($path)); } - else - { - echo"file does not exist"; - } } } $zip->close(); @@ -34,24 +30,22 @@ readfile($zip_name); unlink($zip_name); - exit; } function savenote($title, $content) { global $dir; $path = $dir . '/' . $title; - $lastchanged = filemtime($path); + $lastchanged = filemtime($path . '.md'); $previous = $_POST['lastchanged']; if ((int)$lastchanged > (int)$previous) { $tempcontent = file_get_contents($path . '.md'); if ($tempcontent != $content) { - $temptitle = $title . '_' . $lastchanged; + $temptitle = $title . '_conflict_' . $lastchanged; file_put_contents($dir . '/' . $temptitle . '.md', $tempcontent); array_unshift($_SESSION['index'], $dir . '/' . $temptitle); - echo '
Access denied.