Only hash valid files, returns 404 when not found
[squasher.git] / webroot / squasher.php
index ad61604d15846803ce477803fab75d91ff0d2119..15740d6523bbb1991d4828e1085615605c11856a 100644 (file)
@@ -44,7 +44,11 @@ if (@$_GET['f']) {
        $_hpath_arr=explode("/", $f_o->file);
        $file=array_pop($_hpath_arr); //Remove filename
        $path=implode("/", $_hpath_arr);
-       $squashweb->read_single_file($path, $file);
+       if (!$squashweb->read_single_file($path, $file)) {
+               header('HTTP/1.0 404 Not found');
+               echo('<h1>No file with that hash</h1>');
+               exit();
+       }
        #$squashweb->read_directory($path, false, true, false, false);
 } else {
        //parse folders for readable files