aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-07-04 09:31:13 +0000
committerMario <mario@mariovavti.com>2024-07-04 09:31:13 +0000
commited03befa027aa324fb2aaa766002e647ecaa77d8 (patch)
treef240d738821bf1b3784b315f3f0f737326a07da7
parent464149e22d2654fc548e4c7090358d9007bc8031 (diff)
downloadvolse-hubzilla-ed03befa027aa324fb2aaa766002e647ecaa77d8.tar.gz
volse-hubzilla-ed03befa027aa324fb2aaa766002e647ecaa77d8.tar.bz2
volse-hubzilla-ed03befa027aa324fb2aaa766002e647ecaa77d8.zip
fix possible php error
-rw-r--r--include/zid.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/zid.php b/include/zid.php
index 9f0b23edf..f25a7122f 100644
--- a/include/zid.php
+++ b/include/zid.php
@@ -38,10 +38,16 @@ function is_matrix_url($url) {
* @return string
*/
function zid($s, $address = '') {
- if (!$s || strpos($s,'zid='))
+ if (!strlen($s) || strpos($s,'zid=')) {
return $s;
+ }
$m = parse_url($s);
+
+ if (!is_array($m)) {
+ return $s;
+ }
+
$fragment = ((array_key_exists('fragment',$m) && $m['fragment']) ? $m['fragment'] : false);
if($fragment !== false)
$s = str_replace('#' . $fragment,'',$s);