1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-29 06:23:01 +00:00

Only build an index for the old version if it actually exists

This commit is contained in:
Starbeamrainbowlabs 2015-12-05 17:37:45 +00:00
parent d55132fd19
commit 8924c7b9ac

View file

@ -139,7 +139,9 @@ register_module([
// Update the inverted search index // Update the inverted search index
// Construct an index for the old and new page content // 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); $newindex = search::index($pagedata);
// Compare the indexes of the old and new content // Compare the indexes of the old and new content