]> git.mxchange.org Git - friendica.git/commitdiff
Replicate redirect URL building logic for post requests
authorMatthew Exon <git.mexon@spamgourmet.com>
Mon, 29 Jul 2013 14:33:10 +0000 (22:33 +0800)
committerMatthew Exon <git.mexon@spamgourmet.com>
Mon, 29 Jul 2013 14:34:09 +0000 (22:34 +0800)
include/network.php

index d398d8fa0c2a643b69172473aa865d3969bc6308..a4e0649d08994cea724833bc69f22dc0bdfe1eeb 100644 (file)
@@ -188,7 +188,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0, $timeout = 0)
         preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
         $newurl = trim(array_pop($matches));
                if(strpos($newurl,'/') === 0)
-                       $newurl = $url . $newurl;
+                       $newurl = $old_location_info["scheme"] . "://" . $old_location_info["host"] . $newurl;
         if (filter_var($newurl, FILTER_VALIDATE_URL)) {
             $redirects++;
             return fetch_url($newurl,false,$redirects,$timeout);