Add ppi (pixels per inch) to BookReader metadata API
[bookreader.git] / BookReaderIA / datanode / flipbook_search_br.php
old mode 100755 (executable)
new mode 100644 (file)
index 8adda78..ea95e52
@@ -136,8 +136,10 @@ else
   fatal("Unknown format request. ");
 }
  
+// Ensure file is readable
+checkPrivs($url);
 
-// This looks like where we load the djvu.xml
+// This looks like where we load the djvu.xml - $$$ and rapidly exhaust memory for large books such as OED
 if (!($document = file_get_contents($url)))
   fatal("could not load $url");
 
@@ -309,5 +311,12 @@ function debug_msg($msg, $level)
   }
 }
 
+function checkPrivs($filename) {
+    if (!is_readable($filename)) {
+        header('HTTP/1.1 403 Forbidden');
+        exit(0);
+    }
+}
+
 
 ?>