- if (!is_dir($_SERVER["DOCUMENT_ROOT"]."/proxy"))
- if (is_writable($_SERVER["DOCUMENT_ROOT"]))
- mkdir($_SERVER["DOCUMENT_ROOT"]."/proxy");
+ if (!is_dir($basepath."/proxy"))
+ if (is_writable($basepath))
+ mkdir($basepath."/proxy");
// Look for filename in the arguments
if ((isset($a->argv[1]) OR isset($a->argv[2]) OR isset($a->argv[3])) AND !isset($_REQUEST["url"])) {
// Look for filename in the arguments
if ((isset($a->argv[1]) OR isset($a->argv[2]) OR isset($a->argv[3])) AND !isset($_REQUEST["url"])) {
// advantage: real file access is really fast
// Otherwise write in cachefile
if ($valid AND $direct_cache) {
// advantage: real file access is really fast
// Otherwise write in cachefile
if ($valid AND $direct_cache) {
- file_put_contents($_SERVER["DOCUMENT_ROOT"]."/proxy/".proxy_url($_REQUEST['url'], true).$sizetype, $img_str);
+ file_put_contents($basepath."/proxy/".proxy_url($_REQUEST['url'], true).$sizetype, $img_str);
} elseif ($cachefile != '')
file_put_contents($cachefile, $img_str_orig);
} elseif ($cachefile != '')
file_put_contents($cachefile, $img_str_orig);
// Only continue if it isn't a local image and the isn't deactivated
if (proxy_is_local_image($url)) {
$url = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $url);
// Only continue if it isn't a local image and the isn't deactivated
if (proxy_is_local_image($url)) {
$url = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $url);
$path = substr(hash("md5", $url), 0, 2);
$path = substr(hash("md5", $url), 0, 2);