aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-11-07 13:06:56 -0800
committerfriendica <info@friendica.com>2014-11-07 13:06:56 -0800
commit55f64c37364a1e4ac3e57a6af2953df196589c49 (patch)
tree1c24467c7e4c4a72d30617765db96c9a376e0a0e /include/items.php
parent961049f5faf04edcf3dc5485e76d81460b929efb (diff)
downloadvolse-hubzilla-55f64c37364a1e4ac3e57a6af2953df196589c49.tar.gz
volse-hubzilla-55f64c37364a1e4ac3e57a6af2953df196589c49.tar.bz2
volse-hubzilla-55f64c37364a1e4ac3e57a6af2953df196589c49.zip
tgroup_check - decrypt if obscured before checking body text for reshares
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php
index 325947341..7e2bb4f18 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2974,7 +2974,15 @@ function tgroup_check($uid,$item) {
// At this point we've determined that the person receiving this post was mentioned in it.
// Now let's check if this mention was inside a reshare so we don't spam a forum
- $body = preg_replace('/\[share(.*?)\[\/share\]/','',$item['body']);
+
+ $body = $item['body'];
+
+ if(array_key_exists('item_flags',$item) && ($item['item_flags'] & ITEM_OBSCURED) && $body) {
+ $key = get_config('system','prvkey');
+ $body = crypto_unencapsulate(json_decode($body,true),$key);
+ }
+
+ $body = preg_replace('/\[share(.*?)\[\/share\]/','',$body);
$pattern = '/@\!?\[zrl\=' . preg_quote($term['url'],'/') . '\]' . preg_quote($term['term'] . '+','/') . '\[\/zrl\]/';