X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fproxy.php;h=ff58bba7f1b2dc627bf2ce037cb69bb8da1d470b;hb=a9bed1422e0a476df17a9e6edefce1925404184d;hp=de2810dd78e87ba1ae6294a5d4c5b5047401c1bd;hpb=46ba1a46f5b7b84f6e94fdbdbe87c4f1f320c90f;p=friendica.git diff --git a/mod/proxy.php b/mod/proxy.php index de2810dd78..ff58bba7f1 100644 --- a/mod/proxy.php +++ b/mod/proxy.php @@ -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; @@ -255,7 +255,7 @@ function proxy_url($url, $writemode = false, $size = '') { // 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); + $url = str_replace(normalise_link(App::get_baseurl()) . '/', App::get_baseurl() . '/', $url); return $url; } @@ -297,7 +297,7 @@ function proxy_url($url, $writemode = false, $size = '') { $longpath .= '.' . $extension; } - $proxypath = $a->get_baseurl() . '/proxy/' . $longpath; + $proxypath = App::get_baseurl() . '/proxy/' . $longpath; if ($size != '') { $size = ':' . $size; @@ -308,7 +308,7 @@ function proxy_url($url, $writemode = false, $size = '') { if ((strlen($proxypath) > 250) AND $writemode) { return $shortpath; } elseif (strlen($proxypath) > 250) { - return $a->get_baseurl() . '/proxy/' . $shortpath . '?url=' . urlencode($url); + return App::get_baseurl() . '/proxy/' . $shortpath . '?url=' . urlencode($url); } elseif ($writemode) { return $longpath; } else { @@ -366,7 +366,7 @@ function proxy_img_cb($matches) { function proxy_parse_html($html) { $a = get_app(); - $html = str_replace(normalise_link($a->get_baseurl())."/", $a->get_baseurl()."/", $html); + $html = str_replace(normalise_link(App::get_baseurl())."/", App::get_baseurl()."/", $html); return preg_replace_callback("/(]*src *= *[\"'])([^\"']+)([\"'][^>]*>)/siU", "proxy_img_cb", $html); }