]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Network.php
Merge pull request #6452 from annando/composer
[friendica.git] / src / Util / Network.php
index e7707baf38a8182af47c77e287b40bc281c8d8c1..0acad3e082af14ffeec1684618d9099568803d1d 100644 (file)
@@ -94,7 +94,7 @@ class Network
 
                $stamp1 = microtime(true);
 
-               $a = get_app();
+               $a = \get_app();
 
                $parts = parse_url($url);
                $path_parts = explode('/', defaults($parts, 'path', ''));
@@ -251,7 +251,7 @@ class Network
                        return CurlResult::createErrorCurl($url);
                }
 
-               $a = get_app();
+               $a = \get_app();
                $ch = curl_init($url);
 
                if (($redirects > 8) || (!$ch)) {
@@ -362,7 +362,7 @@ class Network
                /// @TODO Really suppress function outcomes? Why not find them + debug them?
                $h = @parse_url($url);
 
-               if ((is_array($h)) && (@dns_get_record($h['host'], DNS_A + DNS_CNAME) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
+               if (!empty($h['host']) && (@dns_get_record($h['host'], DNS_A + DNS_CNAME) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
                        return $url;
                }
 
@@ -604,7 +604,7 @@ class Network
         */
        public static function finalUrl($url, $depth = 1, $fetchbody = false)
        {
-               $a = get_app();
+               $a = \get_app();
 
                $url = self::stripTrackingQueryParams($url);