From 6a3870556794a5827ebc106d449ba88da6bf489d Mon Sep 17 00:00:00 2001 From: Matthew Exon Date: Mon, 29 Jul 2013 22:33:10 +0800 Subject: [PATCH] Replicate redirect URL building logic for post requests --- include/network.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/network.php b/include/network.php index d398d8fa0c..a4e0649d08 100644 --- a/include/network.php +++ b/include/network.php @@ -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); -- 2.39.5