Permalink
Browse files

Search index is now served as an empty array "[]" if generated json s…

…earch

index files can't be found.
  • Loading branch information...
1 parent afd9bcb commit e887fd8959dbbbda083c7f2abb12e4f3ed1a2347 Stewart Lord committed Jan 1, 2011
Showing with 7 additions and 1 deletion.
  1. +7 −1 search-index.php
View
@@ -18,5 +18,11 @@
ob_start("ob_gzhandler");
echo "$varname = ";
-readfile(dirname(__FILE__) . "/manual/$langcode/$filename.json");
+$file = dirname(__FILE__) . "/manual/$langcode/$filename.json";
+if (is_readable($file)) {
+ readfile($file);
+} else {
+ echo "[]";
+}
+

0 comments on commit e887fd8

Please sign in to comment.