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");
}
}
+function checkPrivs($filename) {
+ if (!is_readable($filename)) {
+ header('HTTP/1.1 403 Forbidden');
+ exit(0);
+ }
+}
+
?>