aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Tagger.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-26 18:29:24 -0800
committerzotlabs <mike@macgirvin.com>2017-11-26 18:29:24 -0800
commit0e91810ed6764fbbee54e918711bfb45a1d9fd72 (patch)
treef6c3d995e438057161ecdd7f0afd479df5a751e6 /Zotlabs/Module/Tagger.php
parente1fdac32782de11e443c7398ff3fb9870fa9b2d9 (diff)
downloadvolse-hubzilla-0e91810ed6764fbbee54e918711bfb45a1d9fd72.tar.gz
volse-hubzilla-0e91810ed6764fbbee54e918711bfb45a1d9fd72.tar.bz2
volse-hubzilla-0e91810ed6764fbbee54e918711bfb45a1d9fd72.zip
pubstream comments and a few other bugfixes that were discovered along the way
Diffstat (limited to 'Zotlabs/Module/Tagger.php')
-rw-r--r--Zotlabs/Module/Tagger.php30
1 files changed, 26 insertions, 4 deletions
diff --git a/Zotlabs/Module/Tagger.php b/Zotlabs/Module/Tagger.php
index 98e901965..603a95f2b 100644
--- a/Zotlabs/Module/Tagger.php
+++ b/Zotlabs/Module/Tagger.php
@@ -11,10 +11,12 @@ class Tagger extends \Zotlabs\Web\Controller {
function get() {
- if(! local_channel() && ! remote_channel()) {
+ if(! local_channel()) {
return;
}
+ $sys = get_sys_channel();
+
$observer_hash = get_observer_hash();
//strip html-tags
$term = notags(trim($_GET['term']));
@@ -26,9 +28,29 @@ class Tagger extends \Zotlabs\Web\Controller {
logger('tagger: tag ' . $term . ' item ' . $item_id);
-
- $r = q("SELECT * FROM item left join xchan on xchan_hash = author_xchan WHERE id = '%s' and uid = %d LIMIT 1",
- dbesc($item_id),
+ $r = q("select * from item where id = %d and uid = %d limit 1",
+ intval($item_id),
+ intval(local_channel())
+ );
+
+ if(! $r) {
+ $r = q("select * from item where id = %d and uid = %d limit 1",
+ intval($item_id),
+ intval($sys['channel_id'])
+ );
+ if($r) {
+ $r = [ copy_of_pubitem($channel, $i[0]['mid']) ];
+ $item_id = (($r) ? $r[0]['id'] : 0);
+ }
+ }
+
+ if(! $r) {
+ notice( t('Post not found.') . EOL);
+ return;
+ }
+
+ $r = q("SELECT * FROM item left join xchan on xchan_hash = author_xchan WHERE id = %d and uid = %d LIMIT 1",
+ intval($item_id),
intval(local_channel())
);