From 0dc959d9fe40bddce5e99b8162bb0e770fc28ed9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 24 Mar 2024 09:58:21 +0000 Subject: Deprecate *_config() functions in core. --- include/zid.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/zid.php') diff --git a/include/zid.php b/include/zid.php index b38457d99..9f0b23edf 100644 --- a/include/zid.php +++ b/include/zid.php @@ -1,5 +1,6 @@ Date: Thu, 4 Jul 2024 09:31:13 +0000 Subject: fix possible php error --- include/zid.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/zid.php') 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 From 04a35dac9aa1949981f2c2d261f869747a0e2686 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 4 Jul 2024 09:41:21 +0000 Subject: revert the strlen check --- include/zid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/zid.php') diff --git a/include/zid.php b/include/zid.php index f25a7122f..05b4cee16 100644 --- a/include/zid.php +++ b/include/zid.php @@ -38,7 +38,7 @@ function is_matrix_url($url) { * @return string */ function zid($s, $address = '') { - if (!strlen($s) || strpos($s,'zid=')) { + if ($s || strpos($s,'zid=')) { return $s; } -- cgit v1.2.3 From f882c44fb397c8a891c0e16541a6bd44a6086c20 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 4 Jul 2024 10:13:08 +0000 Subject: fix wrong logic after last commit --- include/zid.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/zid.php') diff --git a/include/zid.php b/include/zid.php index 05b4cee16..159a3b834 100644 --- a/include/zid.php +++ b/include/zid.php @@ -38,7 +38,7 @@ function is_matrix_url($url) { * @return string */ function zid($s, $address = '') { - if ($s || strpos($s,'zid=')) { + if (!$s || strpos($s,'zid=')) { return $s; } -- cgit v1.2.3