| @@ -1,10 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +$path = '../tmp/'; | |
| 3 | 4 | |
| 4 | 5 | $tempfilename = $_REQUEST['filename'].'.pdf'; |
| 6 | +if (strstr($tempfilename,'/') || strstr($tempfilename,'\\')) { die("Filename should not contain \ or / "); } | |
| 5 | 7 | $opname = $_REQUEST['opname']; |
| 6 | -$path = urldecode($_REQUEST['path']); | |
| 7 | 8 | $dest = $_REQUEST['dest']; |
| 8 | 9 | if ($tempfilename && file_exists($path.$tempfilename)) { |
| 9 | 10 | // mPDF 5.3.17 |
| 10 | 11 | if ($dest=='I') { |
| @@ -37,9 +38,9 @@ | ||
| 37 | 38 | if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) OR empty($_SERVER['HTTP_ACCEPT_ENCODING'])) { |
| 38 | 39 | // don't use length if server using compression |
| 39 | 40 | header('Content-Length: '.$filesize); |
| 40 | 41 | } |
| 41 | - $fd=fopen($path.$tempfilename,'rb'); // mPDF 5.3.85 | |
| 42 | + $fd=fopen($path.$tempfilename,'rb'); | |
| 42 | 43 | fpassthru($fd); |
| 43 | 44 | fclose($fd); |
| 44 | 45 | unlink($path.$tempfilename); |
| 45 | 46 | // ====================== DELETE OLD FILES - Housekeeping ========================================= |