]> git.mxchange.org Git - friendica.git/commitdiff
Merge https://github.com/friendica/friendica into pull
authorfriendica <info@friendica.com>
Tue, 19 Mar 2013 10:31:37 +0000 (03:31 -0700)
committerfriendica <info@friendica.com>
Tue, 19 Mar 2013 10:31:37 +0000 (03:31 -0700)
include/network.php

index 941ef5e1b9db7482555ae4c07a532c5dd0e1c900..f6f59fa2d8f26020ca182461c0962edc1fbfd0a9 100644 (file)
@@ -88,9 +88,10 @@ function fetch_url($url,$binary = false, &$redirects = 0, $timeout = 0, $accept_
                if (($new_location_info["path"] == "") AND ($new_location_info["host"] != ""))
                        $newurl = $new_location_info["scheme"]."://".$new_location_info["host"].$old_location_info["path"];
 
-               //$matches = array();
-               //preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
-               //$newurl = trim(array_pop($matches));
+               $matches = array();
+               if (preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches)) {
+                       $newurl = trim(array_pop($matches));
+               }
                if(strpos($newurl,'/') === 0)
                        $newurl = $url . $newurl;
                $url_parsed = @parse_url($newurl);