diff options
author | Mario <mario@mariovavti.com> | 2021-05-26 09:36:13 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-05-26 09:36:13 +0000 |
commit | ec02eda11323fe27d2b23e6d289eb3d97c9eddc9 (patch) | |
tree | 31b740d0255e8836da3b101f01c2ea6cb91acc47 | |
parent | 8d8523684c2a1eed1cdff2573c9fa9bfbb7959de (diff) | |
download | volse-hubzilla-ec02eda11323fe27d2b23e6d289eb3d97c9eddc9.tar.gz volse-hubzilla-ec02eda11323fe27d2b23e6d289eb3d97c9eddc9.tar.bz2 volse-hubzilla-ec02eda11323fe27d2b23e6d289eb3d97c9eddc9.zip |
handle_tag(): only use xchans with xhchan_deleted = 0
-rw-r--r-- | Zotlabs/Module/Item.php | 2 | ||||
-rw-r--r-- | include/text.php | 24 |
2 files changed, 14 insertions, 12 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 73a943039..518352667 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -822,6 +822,8 @@ class Item extends Controller { $post_tags = []; + + if($mimetype === 'text/bbcode') { require_once('include/text.php'); diff --git a/include/text.php b/include/text.php index 622c44f14..d2ab8bc72 100644 --- a/include/text.php +++ b/include/text.php @@ -2903,7 +2903,7 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true) $newname = substr($name,1); $newname = substr($newname,0,-1); - $r = q("select * from xchan where xchan_addr = '%s' or xchan_url = '%s'", + $r = q("SELECT * FROM xchan WHERE xchan_addr = '%s' OR xchan_url = '%s' AND xchan_deleted = 0", dbesc($newname), dbesc($newname) ); @@ -2929,18 +2929,18 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true) // select someone from this user's contacts by name - $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash - WHERE xchan_name = '%s' AND abook_channel = %d ", - dbesc($newname), - intval($profile_uid) + $r = q("SELECT * FROM abook LEFT JOIN xchan ON abook_xchan = xchan_hash + WHERE xchan_name = '%s' AND abook_channel = %d AND xchan_deleted = 0", + dbesc($newname), + intval($profile_uid) ); // select anybody by full hubloc_addr if((! $r) && strpos($newname,'@')) { - $r = q("SELECT * FROM xchan left join hubloc on xchan_hash = hubloc_hash - WHERE hubloc_addr = '%s' ", - dbesc($newname) + $r = q("SELECT * FROM xchan LEFT JOIN hubloc ON xchan_hash = hubloc_hash + WHERE hubloc_addr = '%s' AND xchan_deleted = 0 ", + dbesc($newname) ); } @@ -2950,10 +2950,10 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true) // strip user-supplied wildcards before running a wildcard search $newname = str_replace('%','',$newname); - $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash - WHERE xchan_addr like ('%s') AND abook_channel = %d ", - dbesc(((strpos($newname,'@')) ? $newname : $newname . '@%')), - intval($profile_uid) + $r = q("SELECT * FROM abook LEFT JOIN xchan ON abook_xchan = xchan_hash + WHERE xchan_addr LIKE ('%s') AND abook_channel = %d AND xchan_deleted = 0", + dbesc(((strpos($newname,'@')) ? $newname : $newname . '@%')), + intval($profile_uid) ); } |