]> git.wh0rd.org - tt-rss.git/blob - mobile/image.php
modify include path order (closes #514)
[tt-rss.git] / mobile / image.php
1 <?php
2 set_include_path(dirname(__FILE__) . PATH_SEPARATOR .
3 dirname(dirname(__FILE__)) . PATH_SEPARATOR .
4 dirname(dirname(__FILE__)) . "/include" . PATH_SEPARATOR .
5 get_include_path());
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 ?>