aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-11 09:51:21 +0000
committerMario <mario@mariovavti.com>2022-02-11 09:51:21 +0000
commit139ffae3674e59307b46c67b0dcf77be9ec87b19 (patch)
tree446c3ab4ce6d36a5378bf70242b008ec8899f70a
parent51a48cc264c7636b880751362aa0a2874118b513 (diff)
downloadvolse-hubzilla-139ffae3674e59307b46c67b0dcf77be9ec87b19.tar.gz
volse-hubzilla-139ffae3674e59307b46c67b0dcf77be9ec87b19.tar.bz2
volse-hubzilla-139ffae3674e59307b46c67b0dcf77be9ec87b19.zip
fix another deprecation warning
-rw-r--r--include/network.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/network.php b/include/network.php
index 044678a05..fa408e602 100644
--- a/include/network.php
+++ b/include/network.php
@@ -365,9 +365,14 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) {
if($http_code == 301 || $http_code == 302 || $http_code == 303 || $http_code == 307 || $http_code == 308) {
$matches = array();
preg_match('/(Location:|URI:)(.*?)\n/', $header, $matches);
- $newurl = trim(array_pop($matches));
- if(strpos($newurl,'/') === 0)
+
+ $newurl = '';
+ if (array_pop($matches))
+ $newurl = trim(array_pop($matches));
+
+ if($newurl && strpos($newurl,'/') === 0)
$newurl = $url . $newurl;
+
$url_parsed = @parse_url($newurl);
if (isset($url_parsed)) {
curl_close($ch);