X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fproxy.php;h=6434cf8e64722d72b0d84b0e1506673e019003fa;hb=6cef88c24ead66ed59d7fde4b9f975714c0ddddc;hp=f2a7c30eacb4332a481a5389cb2ff86bf1f63691;hpb=1cf95066461c58b9f7d6ca716e13e8fe24e6f1ef;p=friendica.git diff --git a/mod/proxy.php b/mod/proxy.php index f2a7c30eac..6434cf8e64 100644 --- a/mod/proxy.php +++ b/mod/proxy.php @@ -44,7 +44,7 @@ function proxy_init() { $thumb = false; $size = 1024; $sizetype = ""; - $basepath = $a->get_basepath(); + $basepath = App::get_basepath(); // If the cache path isn't there, try to create it if (!is_dir($basepath."/proxy")) @@ -136,7 +136,7 @@ function proxy_init() { if (!$direct_cache AND ($cachefile == "")) { $r = qu("SELECT * FROM `photo` WHERE `resource-id` = '%s' LIMIT 1", $urlhash); - if (count($r)) { + if (dbm::is_result($r)) { $img_str = $r[0]['data']; $mime = $r[0]["desc"]; if ($mime == "") $mime = "image/jpeg"; @@ -144,7 +144,7 @@ function proxy_init() { } else $r = array(); - if (!count($r)) { + if (!dbm::is_result($r)) { // It shouldn't happen but it does - spaces in URL $_REQUEST['url'] = str_replace(" ", "+", $_REQUEST['url']); $redirects = 0; @@ -264,10 +264,10 @@ function proxy_url($url, $writemode = false, $size = '') { } // Image URL may have encoded ampersands for display which aren't desirable for proxy - $url = html_entity_decode($url, ENT_NOQUOTES, 'UTF8'); + $url = html_entity_decode($url, ENT_NOQUOTES, 'utf-8'); // Creating a sub directory to reduce the amount of files in the cache directory - $basepath = $a->get_basepath() . '/proxy'; + $basepath = App::get_basepath() . '/proxy'; $shortpath = hash('md5', $url); $longpath = substr($shortpath, 0, 2);