diff options
-rwxr-xr-x | include/items.php | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php index 8df090e0b..487666e36 100755 --- a/include/items.php +++ b/include/items.php @@ -2450,16 +2450,24 @@ function tag_deliver($uid,$item_id) { $body = preg_replace('/\[share(.*?)\[\/share\]/','',$body); + $tagged = false; + $plustagged = false; + + $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'],'/') . '\[\/zrl\]/'; + if(preg_match($pattern,$body,$matches)) + $tagged = true; + $pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($u[0]['channel_name'] . '+','/') . '\[\/zrl\]/'; + if(preg_match($pattern,$body,$matches)) + $plustagged = true; - if(! preg_match($pattern,$body,$matches)) { + if(! ($tagged || $plustagged)) { logger('tag_deliver: mention was in a reshare - ignoring'); return; } - - // All good. - // Send a notification + + // Valid tag. Send a notification require_once('include/enotify.php'); notification(array( @@ -2472,6 +2480,14 @@ function tag_deliver($uid,$item_id) { 'otype' => 'item' )); + // Just a normal tag? + + if(! $plustagged) { + logger('tag_deliver: not a plus tag', LOGGER_DEBUG); + return; + } + + // plustagged - keep going, next check permissions if(! perm_is_allowed($uid,$item['author_xchan'],'tag_deliver')) { logger('tag_delivery denied for uid ' . $uid . ' and xchan ' . $item['author_xchan']); |