]>
Commit | Line | Data |
---|---|---|
1 | <?php | |
2 | set_include_path(get_include_path() . PATH_SEPARATOR . | |
3 | dirname(__FILE__) . PATH_SEPARATOR . | |
4 | dirname(dirname(__FILE__)) . PATH_SEPARATOR . | |
5 | dirname(dirname(__FILE__)) . "/include" ); | |
6 | ||
7 | require_once "config.php"; | |
8 | ||
9 | chdir('..'); | |
10 | ||
11 | $filename = CACHE_DIR . '/images/' . sha1($_GET['url']) . '.png'; | |
12 | ||
13 | if (file_exists($filename)) { | |
14 | header("Content-type: image/png"); | |
15 | echo file_get_contents($filename); | |
16 | } else { | |
17 | header("Location: " . $_GET['url']); | |
18 | } | |
19 | ?> |