|
7 | 7 | $min = !empty($_REQUEST['min']) ? 'min.' : '';
|
8 | 8 | $files = explode('-', preg_replace("/[^a-z0-9-]/", '', substr($_REQUEST['modules'], 0, 1024)));
|
9 | 9 | if (!$files || $files === ['']) {
|
10 |
| - $content = file_get_contents($dir.'/pnotify.'.$ext); |
11 |
| - header("Content-Disposition: $type; filename=pnotify.custom.$min$ext"); |
12 |
| - header("Content-Length: ".strlen($content)); |
13 |
| - header("Content-Type: $mime"); |
14 |
| - echo $content; |
15 |
| - exit; |
| 10 | + $content = file_get_contents($dir.'/pnotify.'.$ext); |
| 11 | + header("Content-Disposition: $type; filename=pnotify.custom.$min$ext"); |
| 12 | + header("Content-Length: ".strlen($content)); |
| 13 | + header("Content-Type: $mime"); |
| 14 | + echo $content; |
| 15 | + exit; |
16 | 16 | }
|
17 | 17 | sort($files);
|
18 | 18 |
|
19 | 19 | if ($min === '') {
|
20 |
| - $content = "/* PNotify modules included in this custom build file:\n". |
21 |
| - implode("\n", $files). |
22 |
| - "\n*/\n"; |
| 20 | + $content = "/* PNotify modules included in this custom build file:\n". |
| 21 | + implode("\n", $files). |
| 22 | + "\n*/\n"; |
23 | 23 | }
|
24 | 24 |
|
25 | 25 | $content .= file_get_contents("$dir/pnotify.$ext")."\n";
|
26 | 26 | foreach ($files as $cur_file) {
|
27 |
| - $filename = "$dir/pnotify.$cur_file.$ext"; |
28 |
| - if (!file_exists($filename)) { |
29 |
| - $filename_other = "$dir/pnotify.$cur_file.".($ext === "css" ? "js" : "css"); |
30 |
| - if (file_exists($filename_other)) { |
31 |
| - continue; |
32 |
| - } |
33 |
| - header('HTTP/1.1 400 Bad Request', true, 400); |
34 |
| - echo "Your request could not be completed because a file you requested is invalid."; |
35 |
| - exit; |
| 27 | + $filename = "$dir/pnotify.$cur_file.$ext"; |
| 28 | + if (!file_exists($filename)) { |
| 29 | + $filename_other = "$dir/pnotify.$cur_file.".($ext === "css" ? "js" : "css"); |
| 30 | + if (file_exists($filename_other)) { |
| 31 | + continue; |
36 | 32 | }
|
37 |
| - $content .= file_get_contents($filename)."\n"; |
| 33 | + header('HTTP/1.1 400 Bad Request', true, 400); |
| 34 | + echo "Your request could not be completed because a file you requested is invalid."; |
| 35 | + exit; |
| 36 | + } |
| 37 | + $content .= file_get_contents($filename)."\n"; |
38 | 38 | }
|
39 | 39 |
|
40 | 40 |
|
|
0 commit comments