Remove "More..." from info modal. Add current window location to OL problem contact...
[bookreader.git] / BookReaderIA / datanode / BookReaderGetTextWrapper.php
index 436bed7..03d6367 100644 (file)
@@ -22,8 +22,20 @@ This file is part of BookReader.
 */
 
 //$env = 'LD_LIBRARY_PATH=/petabox/sw/lib/lxml/lib PYTHONPATH=/petabox/sw/lib/lxml/lib/python2.5/site-packages:$PYTHONPATH';
-$path=$_GET['path'];
-$page=$_GET['page'];
-$callback=$_GET['callback'];
+
+checkPrivs($_GET['path']);
+
+$path     = escapeshellarg($_GET['path']);
+$page     = escapeshellarg($_GET['page']);
+$callback = escapeshellarg($_GET['callback']);
+
+header('Content-Type: application/javascript');
 passthru("python BookReaderGetText.py $path $page $callback");
-?>
\ No newline at end of file
+
+function checkPrivs($filename) {
+    if (!is_readable($filename)) {        
+        header('HTTP/1.1 403 Forbidden');
+        exit(0);
+    }
+}
+?>