From: Matthew Exon Date: Thu, 14 Mar 2013 05:50:45 +0000 (+0800) Subject: Restore redirect functionality removed by change 452ff19d X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c53bdfb1639d7ca92fa6fbbcfcb75932f2da5088;p=friendica.git Restore redirect functionality removed by change 452ff19d --- diff --git a/include/network.php b/include/network.php index 941ef5e1b9..f6f59fa2d8 100644 --- a/include/network.php +++ b/include/network.php @@ -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);