aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-07-04 09:30:21 +0000
committerMario <mario@mariovavti.com>2024-07-04 09:30:21 +0000
commitf944f46744c45aa64068b33790692f89f03fce50 (patch)
tree7d6ca5c97e01d00b8738f149cc60a97b1e7534bd
parent3f5c45a567c3dc61b755b75584b16fc98e223bea (diff)
downloadvolse-hubzilla-f944f46744c45aa64068b33790692f89f03fce50.tar.gz
volse-hubzilla-f944f46744c45aa64068b33790692f89f03fce50.tar.bz2
volse-hubzilla-f944f46744c45aa64068b33790692f89f03fce50.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);