aboutsummaryrefslogtreecommitdiffstats
path: root/include/zid.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-02-18 19:32:45 +0000
committerMario <mario@mariovavti.com>2021-02-18 19:32:45 +0000
commitc34fc416a28e62ae87fbcb25ae015b8b1f114df9 (patch)
treedf1591c3e54626a6e0fb21f4ffa95a92c18f1b3b /include/zid.php
parent7794ee5a8840f530093e0df41042dc082df978ae (diff)
downloadvolse-hubzilla-c34fc416a28e62ae87fbcb25ae015b8b1f114df9.tar.gz
volse-hubzilla-c34fc416a28e62ae87fbcb25ae015b8b1f114df9.tar.bz2
volse-hubzilla-c34fc416a28e62ae87fbcb25ae015b8b1f114df9.zip
php8 warnings
Diffstat (limited to 'include/zid.php')
-rw-r--r--include/zid.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/zid.php b/include/zid.php
index e24b0035d..75414a691 100644
--- a/include/zid.php
+++ b/include/zid.php
@@ -58,7 +58,7 @@ function zid($s, $address = '') {
$mine_parsed = parse_url($mine);
$s_parsed = parse_url($s);
- if($mine_parsed['host'] === $s_parsed['host'])
+ if(isset($mine_parsed['host']) && isset($s_parsed['host']) && $mine_parsed['host'] === $s_parsed['host'])
$url_match = true;
if ($mine && $myaddr && (! $url_match))
@@ -209,21 +209,21 @@ function red_zrl_callback($matches) {
// Catch and exclude trailing punctuation
preg_match("/[.,;:!?)]*$/i", $matches[2], $pts);
$matches[2] = substr($matches[2], 0, strlen($matches[2])-strlen($pts[0]));
-
+
$zrl = is_matrix_url($matches[2]);
-
+
$t = strip_zids($matches[2]);
if($t !== $matches[2]) {
$zrl = true;
$matches[2] = $t;
}
-
+
if($matches[1] === '#^')
$matches[1] = '';
-
+
if($zrl)
return $matches[1] . '#^[zrl=' . $matches[2] . ']' . $matches[2] . '[/zrl]' . $pts[0];
-
+
return $matches[1] . '#^[url=' . $matches[2] . ']' . $matches[2] . '[/url]' . $pts[0];
}