diff options
Diffstat (limited to 'inc/3rdparty/libraries/mpdf/examples/show_code.php')
-rw-r--r-- | inc/3rdparty/libraries/mpdf/examples/show_code.php | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/inc/3rdparty/libraries/mpdf/examples/show_code.php b/inc/3rdparty/libraries/mpdf/examples/show_code.php deleted file mode 100644 index 32bc7625..00000000 --- a/inc/3rdparty/libraries/mpdf/examples/show_code.php +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | if ($_REQUEST['filename']) { $filename = $_REQUEST['filename']; } | ||
4 | else { die("No file specified"); } | ||
5 | |||
6 | include("../mpdf.php"); | ||
7 | |||
8 | $mpdf=new mPDF('utf-8-s'); | ||
9 | $mpdf->debug=true; | ||
10 | $mpdf->tabSpaces = 6; | ||
11 | |||
12 | $mpdf->allow_charset_conversion=true; | ||
13 | $mpdf->charset_in='windows-1252'; | ||
14 | |||
15 | //============================================================== | ||
16 | preg_match('/example[0]{0,1}(\d+)_(.*?)\.php/',$filename,$m); | ||
17 | $num = intval($m[1]); | ||
18 | $title = ucfirst(preg_replace('/_/',' ',$m[2])); | ||
19 | |||
20 | if (!$num || !$title) { die("Invalid file"); } | ||
21 | if (preg_match('/\//', $filename) || !preg_match('/\.php$/',$filename)) { die("Hacking attempt"); } | ||
22 | |||
23 | $html = ' | ||
24 | <h1>mPDF</h1> | ||
25 | <h2>Example '.$num.'. '.$title.'</h2> | ||
26 | <div style="border:1px solid #555555; background-color: #DDDDDD; padding: 1em; font-size:8pt; font-family: lucidaconsole, mono;"> | ||
27 | '; | ||
28 | $lines = file($filename); | ||
29 | |||
30 | $html .= '<pre>'; | ||
31 | foreach($lines AS $line) { | ||
32 | $html .= htmlspecialchars($line); | ||
33 | } | ||
34 | $html .= '</pre>'; | ||
35 | $html .= '</div>'; | ||
36 | |||
37 | $mpdf->WriteHTML($html,2); // The 2 is important to prevent <style etc. being parsed | ||
38 | |||
39 | $mpdf->Output(); | ||
40 | exit; | ||
41 | //============================================================== | ||
42 | //============================================================== | ||
43 | //============================================================== | ||
44 | //============================================================== | ||
45 | //============================================================== | ||
46 | |||
47 | |||
48 | ?> \ No newline at end of file | ||