]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Network.php
Merge remote-tracking branch 'upstream/3.6-rc' into url-shorten-ostatus
[friendica.git] / src / Util / Network.php
index c9955f800f40252d588504590016d266f2024a36..d25b799242e052bc4b3406c2b873bca97a166ee8 100644 (file)
@@ -217,7 +217,7 @@ class Network
 
                        $newurl = $curl_info['redirect_url'];
 
-                       if (($new_location_info['path'] == '') && ( $new_location_info['host'] != '')) {
+                       if (($new_location_info['path'] == '') && ($new_location_info['host'] != '')) {
                                $newurl = $new_location_info['scheme'] . '://' . $new_location_info['host'] . $old_location_info['path'];
                        }
 
@@ -229,6 +229,11 @@ class Network
                        if (strpos($newurl, '/') === 0) {
                                $newurl = $old_location_info["scheme"]."://".$old_location_info["host"].$newurl;
                        }
+                       $old_location_query = @parse_url($url, PHP_URL_QUERY);
+
+                       if ($old_location_query != '') {
+                               $newurl .= '?' . $old_location_query;
+                       }
 
                        if (filter_var($newurl, FILTER_VALIDATE_URL)) {
                                $redirects++;