From f944f46744c45aa64068b33790692f89f03fce50 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 4 Jul 2024 09:30:21 +0000 Subject: fix possible php error --- include/zid.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3