ここの情報は古いです。ご理解頂いた上でお取り扱いください。
Line | |
---|
1 | <?php |
---|
2 | |
---|
3 | $request_uri = $_SERVER['REQUEST_URI']; |
---|
4 | |
---|
5 | chdir('../'); |
---|
6 | require_once './config.inc.php'; |
---|
7 | |
---|
8 | $regexp = '/img\/(jpg|gif|png)\/w(\d+)?_h(\d+)?\/' . |
---|
9 | OPENPNE_IMG_CACHE_PREFIX.'(\w+)\.(?:jpe?g|gif|png)$/'; |
---|
10 | if (preg_match($regexp, $request_uri, $matches)) { |
---|
11 | $f = $matches[1]; |
---|
12 | $w = $matches[2]; |
---|
13 | $h = $matches[3]; |
---|
14 | $filename = preg_replace('/_(jpe?g|gif|png)$/', '.\\1', $matches[4]); |
---|
15 | |
---|
16 | $_GET['filename'] = $filename; |
---|
17 | $_GET['w'] = $w; |
---|
18 | $_GET['h'] = $h; |
---|
19 | $_GET['f'] = $f; |
---|
20 | require_once './img.php'; |
---|
21 | exit; |
---|
22 | } else { |
---|
23 | display_error_404(); |
---|
24 | } |
---|
25 | |
---|
26 | function display_error_404() |
---|
27 | { |
---|
28 | header('HTTP/1.0 404 Not Found'); |
---|
29 | echo <<<EOD |
---|
30 | <html><head><title>404 Not Found</title></head> |
---|
31 | <body> |
---|
32 | <h1>Not Found</h1> |
---|
33 | <p>The requested URL was not found on this server.</p> |
---|
34 | </body></html> |
---|
35 | EOD; |
---|
36 | exit; |
---|
37 | } |
---|
38 | |
---|
39 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.
Download in other formats: