5,29d4 < < ini_set('display_errors', false); // thanks to https://stackoverflow.com/questions/8440439/safely-catch-a-allowed-memory-size-exhausted-error-in-php < < error_reporting(-1); < < set_error_handler(function($code, $string, $file, $line) { < throw new ErrorException($string, null, $code, $file, $line); < }); < < < register_shutdown_function(function(){ < global $zip, $zipfile; < $error = error_get_last(); < if (null !== $error) { < if ($zip != null) { zip_close($zip); $zip=null; } < if ($zipfile != "") { if (file_exists($zipfile)) { unlink($zipfile); } } < echo "eRrOr " . $error['message']; < exit; < //echo 'Caught at shutdown ' . $error['message']; < } < }); < < $zip=null; < $zipfile=""; < 32,33d6 < try { < $infile=str_replace("+"," ",$_GET['filename']); 35,36c8 < $infile='../' . explode('rjmprogramming.com.au/',str_replace("+"," ",$_GET['filename']))[1]; < $contis=file_get_contents($infile); --- > $contis=file_get_contents('../' . explode('rjmprogramming.com.au/',str_replace("+"," ",$_GET['filename']))[1]); 38,39c10 < $infile='../' . explode('RJMPROGRAMMING.COM.AU/',str_replace("+"," ",$_GET['filename']))[1]; < $contis=file_get_contents($infile); --- > $contis=file_get_contents('../' . explode('RJMPROGRAMMING.COM.AU/',str_replace("+"," ",$_GET['filename']))[1]); 41,56c12 < $contis=file_get_contents($infile); < } < } catch(Exception $exception) { < $contis=""; < } < try { < if ($contis == "") { < if (!file_exists($infile)) { < $outxml="eRrOr Zipfile " . $infile . " not found"; < echo $outxml; < exit; < } else { < $outxml="eRrOr Zipfile " . $infile . " empty"; < echo $outxml; < exit; < } --- > $contis=file_get_contents(str_replace("+"," ",$_GET['filename'])); 75d30 < $outxml=" "; 83d37 < if ($outxml == " ") { $outxml=""; } 92d45 < $zip=null; 94d46 < if ($outxml == " ") { $outxml="eRrOr In " . $infile . " no relevant " . $ofwhat . " files found"; } 102,104d53 < } catch(Exception $exception) { < echo 'Caught in try/catch ' . $exception->getMessage() . ' at ' . $exception->getLine(); < }