]> git.mxchange.org Git - friendica.git/blobdiff - mod/proxy.php
More usage of dbm::is_result($r) instead of count($r):
[friendica.git] / mod / proxy.php
index f2a7c30eacb4332a481a5389cb2ff86bf1f63691..612dc910a03978c3212658ba9037f1e4248500a2 100644 (file)
@@ -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,7 +264,7 @@ 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';