From 8924c7b9ac062bedcc2660f3db958fb70ac73f9c Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 5 Dec 2015 17:37:45 +0000 Subject: [PATCH] Only build an index for the old version if it actually exists --- modules/page-edit.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/page-edit.php b/modules/page-edit.php index cc2dfdc..51c7fb1 100644 --- a/modules/page-edit.php +++ b/modules/page-edit.php @@ -139,7 +139,9 @@ register_module([ // Update the inverted search index // Construct an index for the old and new page content - $oldindex = search::index(file_get_contents("$env->page.md")); + $oldindex = []; + if(file_exists("$env->page.md")) + $oldindex = search::index(file_get_contents("$env->page.md")); $newindex = search::index($pagedata); // Compare the indexes of the old and new content