aboutsummaryrefslogtreecommitdiffstats
path: root/include/zid.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-01-18 13:20:23 +0100
committerMario Vavti <mario@mariovavti.com>2018-01-18 13:20:23 +0100
commita0e1a8e0a20df640ef951dee4fb3c6ed19faee03 (patch)
tree672bdd787b969c495d2a279da14c0781adb89a29 /include/zid.php
parenta486c906863a59c0ebed80192b2c0e9aeb111f12 (diff)
parenteb86ffefbfb38cf76316940a6aa164530f9b9348 (diff)
downloadvolse-hubzilla-a0e1a8e0a20df640ef951dee4fb3c6ed19faee03.tar.gz
volse-hubzilla-a0e1a8e0a20df640ef951dee4fb3c6ed19faee03.tar.bz2
volse-hubzilla-a0e1a8e0a20df640ef951dee4fb3c6ed19faee03.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/zid.php')
-rw-r--r--include/zid.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/zid.php b/include/zid.php
index 6ebc9a6ab..b3a7d1e6a 100644
--- a/include/zid.php
+++ b/include/zid.php
@@ -127,8 +127,11 @@ function clean_query_string($s = '') {
* @return string
*/
function zidify_callback($match) {
- $is_zid = ((feature_enabled(local_channel(), 'sendzid')) || (strpos($match[1], 'zrl')) ? true : false);
- $replace = '<a' . $match[1] . ' href="' . (($is_zid) ? zid($match[2]) : $match[2]) . '"';
+
+ $arr = [ 'zid' => ((strpos($match[1],'zrl')) ? true : false), 'url' => $match[2] ];
+ call_hooks('zidify', $arr);
+
+ $replace = '<a' . $match[1] . ' href="' . (intval($arr['zid']) ? zid($arr['url']) : $arr['url']) . '"';
$x = str_replace($match[0], $replace, $match[0]);
@@ -136,8 +139,11 @@ function zidify_callback($match) {
}
function zidify_img_callback($match) {
- $is_zid = ((feature_enabled(local_channel(), 'sendzid')) || (strpos($match[1], 'zrl')) ? true : false);
- $replace = '<img' . $match[1] . ' src="' . (($is_zid) ? zid($match[2]) : $match[2]) . '"';
+
+ $arr = [ 'zid' => ((strpos($match[1],'zrl')) ? true : false), 'url' => $match[2] ];
+ call_hooks('zidify', $arr);
+
+ $replace = '<img' . $match[1] . ' src="' . (intval($arr['zid']) ? zid($arr['url']) : $arr['url']) . '"';
$x = str_replace($match[0], $replace, $match[0]);