diff options
author | tcit <tcit@tcit.fr> | 2014-09-27 19:34:17 +0200 |
---|---|---|
committer | tcit <tcit@tcit.fr> | 2014-09-27 19:34:17 +0200 |
commit | 824f8c45edb20e27221e92805b0090f1768a2756 (patch) | |
tree | 8563a41cc27619347c851b3a06285bf2474b69dd /inc/3rdparty/libraries/mpdf/includes/out.php | |
parent | d4690a8fa18c27c6d98c1c76ac1d1d2c35a1ebbb (diff) | |
download | wallabag-824f8c45edb20e27221e92805b0090f1768a2756.tar.gz wallabag-824f8c45edb20e27221e92805b0090f1768a2756.tar.zst wallabag-824f8c45edb20e27221e92805b0090f1768a2756.zip |
changed mpdf with tcpdf
Diffstat (limited to 'inc/3rdparty/libraries/mpdf/includes/out.php')
-rw-r--r-- | inc/3rdparty/libraries/mpdf/includes/out.php | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/inc/3rdparty/libraries/mpdf/includes/out.php b/inc/3rdparty/libraries/mpdf/includes/out.php deleted file mode 100644 index 75da4553..00000000 --- a/inc/3rdparty/libraries/mpdf/includes/out.php +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | $path = '../tmp/'; | ||
4 | |||
5 | $tempfilename = $_REQUEST['filename'].'.pdf'; | ||
6 | if (strstr($tempfilename,'/') || strstr($tempfilename,'\\')) { die("Filename should not contain \ or / "); } | ||
7 | $opname = $_REQUEST['opname']; | ||
8 | $dest = $_REQUEST['dest']; | ||
9 | if ($tempfilename && file_exists($path.$tempfilename)) { | ||
10 | // mPDF 5.3.17 | ||
11 | if ($dest=='I') { | ||
12 | if(PHP_SAPI!='cli') { | ||
13 | header('Content-Type: application/pdf'); | ||
14 | header('Content-disposition: inline; filename="'.$name.'"'); | ||
15 | header('Cache-Control: public, must-revalidate, max-age=0'); | ||
16 | header('Pragma: public'); | ||
17 | header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); | ||
18 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | else if ($dest=='D') { | ||
23 | header('Content-Description: File Transfer'); | ||
24 | if (headers_sent()) | ||
25 | $this->Error('Some data has already been output to browser, can\'t send PDF file'); | ||
26 | header('Content-Transfer-Encoding: binary'); | ||
27 | header('Cache-Control: public, must-revalidate, max-age=0'); | ||
28 | header('Pragma: public'); | ||
29 | header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); | ||
30 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); | ||
31 | header('Content-Type: application/force-download'); | ||
32 | header('Content-Type: application/octet-stream', false); | ||
33 | header('Content-Type: application/download', false); | ||
34 | header('Content-Type: application/pdf', false); | ||
35 | header('Content-disposition: attachment; filename="'.$name.'"'); | ||
36 | } | ||
37 | $filesize = filesize($path.$tempfilename); | ||
38 | if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) OR empty($_SERVER['HTTP_ACCEPT_ENCODING'])) { | ||
39 | // don't use length if server using compression | ||
40 | header('Content-Length: '.$filesize); | ||
41 | } | ||
42 | $fd=fopen($path.$tempfilename,'rb'); | ||
43 | fpassthru($fd); | ||
44 | fclose($fd); | ||
45 | unlink($path.$tempfilename); | ||
46 | // ====================== DELETE OLD FILES - Housekeeping ========================================= | ||
47 | // Clear any files in directory that are >24 hrs old | ||
48 | $interval = 86400; | ||
49 | if ($handle = opendir(dirname($path.'dummy'))) { | ||
50 | while (false !== ($file = readdir($handle))) { | ||
51 | if (((filemtime($path.$file)+$interval) < time()) && ($file != "..") && ($file != ".") && substr($file, -3)=='pdf') { | ||
52 | unlink($path.$file); | ||
53 | } | ||
54 | } | ||
55 | closedir($handle); | ||
56 | } | ||
57 | exit; | ||
58 | } | ||
59 | ?> \ No newline at end of file | ||