]> git.mxchange.org Git - friendica.git/blobdiff - include/network.php
New dba functions
[friendica.git] / include / network.php
index 7d8cf36118a0363444edbebeca1eeb1647554ba6..4bf6868822b4549986f3bfbae630c3a9366c7f44 100644 (file)
@@ -187,7 +187,7 @@ function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = array()) {
 
                $newurl = $curl_info['redirect_url'];
 
-               if (($new_location_info['path'] == '') AND ( $new_location_info['host'] != '')) {
+               if (($new_location_info['path'] == '') && ( $new_location_info['host'] != '')) {
                        $newurl = $new_location_info['scheme'] . '://' . $new_location_info['host'] . $old_location_info['path'];
                }
 
@@ -220,8 +220,8 @@ function z_fetch_url($url, $binary = false, &$redirects = 0, $opts = array()) {
        if (!$ret['success']) {
                $ret['error'] = curl_error($ch);
                $ret['debug'] = $curl_info;
-               logger('z_fetch_url: error: ' . $url . ': ' . $ret['error'], LOGGER_DEBUG);
-               logger('z_fetch_url: debug: ' . print_r($curl_info, true), LOGGER_DATA);
+               logger('z_fetch_url: error: '.$url.': '.$ret['return_code'].' - '.$ret['error'], LOGGER_DEBUG);
+               logger('z_fetch_url: debug: '.print_r($curl_info, true), LOGGER_DATA);
        }
 
        $ret['body'] = substr($s, strlen($header));
@@ -818,8 +818,8 @@ function original_url($url, $depth = 1, $fetchbody = false) {
        if ($http_code == 0)
                return($url);
 
-       if ((($curl_info['http_code'] == "301") OR ($curl_info['http_code'] == "302"))
-               AND (($curl_info['redirect_url'] != "") OR ($curl_info['location'] != ""))) {
+       if ((($curl_info['http_code'] == "301") || ($curl_info['http_code'] == "302"))
+               && (($curl_info['redirect_url'] != "") || ($curl_info['location'] != ""))) {
                if ($curl_info['redirect_url'] != "")
                        return(original_url($curl_info['redirect_url'], ++$depth, $fetchbody));
                else
@@ -835,7 +835,7 @@ function original_url($url, $depth = 1, $fetchbody = false) {
                return($url);
 
        // if it isn't a HTML file then exit
-       if (($curl_info["content_type"] != "") AND !strstr(strtolower($curl_info["content_type"]),"html"))
+       if (($curl_info["content_type"] != "") && !strstr(strtolower($curl_info["content_type"]),"html"))
                return($url);
 
        $stamp1 = microtime(true);
@@ -929,7 +929,7 @@ function json_return_and_die($x) {
  */
 function matching_url($url1, $url2) {
 
-       if (($url1 == "") OR ($url2 == ""))
+       if (($url1 == "") || ($url2 == ""))
                return "";
 
        $url1 = normalise_link($url1);
@@ -938,7 +938,7 @@ function matching_url($url1, $url2) {
        $parts1 = parse_url($url1);
        $parts2 = parse_url($url2);
 
-       if (!isset($parts1["host"]) OR !isset($parts2["host"]))
+       if (!isset($parts1["host"]) || !isset($parts2["host"]))
                return "";
 
        if ($parts1["scheme"] != $parts2["scheme"])
@@ -967,7 +967,7 @@ function matching_url($url1, $url2) {
                if ($path1 == $path2)
                        $path .= $path1."/";
 
-       } while (($path1 == $path2) AND ($i++ <= count($pathparts1)));
+       } while (($path1 == $path2) && ($i++ <= count($pathparts1)));
 
        $match .= $path;