X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=mod%2Ftagger.php;h=6212e2b9b3e82932b8ea2982051db4125b6caece;hb=1872cf2b2d14be5c4b8fbc9e2cf61f9fcd9e2f88;hp=4127aaadde4f4c6a7fabc783191de19c34a48574;hpb=4218e3f4945af7101c626852bda09d2c591b8e0c;p=friendica.git
diff --git a/mod/tagger.php b/mod/tagger.php
index 4127aaadde..6212e2b9b3 100644
--- a/mod/tagger.php
+++ b/mod/tagger.php
@@ -11,7 +11,9 @@ function tagger_content(&$a) {
return;
}
- $term= notags(trim($_GET['term']));
+ $term = notags(trim($_GET['term']));
+ // no commas allowed
+ $term = str_replace(array(',',' '),array('','_'),$term);
if(! $term)
return;
@@ -64,14 +66,14 @@ function tagger_content(&$a) {
}
$uri = item_new_uri($a->get_hostname(),$owner_uid);
-
+ $xterm = xmlify($term);
$post_type = (($item['resource-id']) ? t('photo') : t('status'));
$targettype = (($item['resource-id']) ? ACTIVITY_OBJ_PHOTO : ACTIVITY_OBJ_NOTE );
$link = xmlify('' . "\n") ;
- $body = $item['body'];
+ $body = xmlify($item['body']);
$target = <<< EOT
@@ -84,7 +86,7 @@ function tagger_content(&$a) {
EOT;
- $tagid = $a->get_baseurl() . '/search?search=' . $term;
+ $tagid = $a->get_baseurl() . '/search?tag=' . $term;
$objtype = ACTIVITY_OBJ_TAGTERM;
$obj = <<< EOT
@@ -93,8 +95,8 @@ EOT;
1
$tagid
$tagid
-
$term
- $term
+ $xterm
+ $xterm
EOT;
@@ -103,7 +105,7 @@ EOT;
if(! isset($bodyverb))
return;
- $termlink = '#[url=' . $a->get_baseurl() . '/search?search=' . urlencode($term) . ']'. $term . '[/url]';
+ $termlink = html_entity_decode('⌗') . '[url=' . $a->get_baseurl() . '/search?tag=' . urlencode($term) . ']'. $term . '[/url]';
$arr = array();
@@ -132,6 +134,7 @@ EOT;
$arr['target'] = $target;
$arr['object-type'] = $objtype;
$arr['object'] = $obj;
+ $arr['private'] = $item['private'];
$arr['allow_cid'] = $item['allow_cid'];
$arr['allow_gid'] = $item['allow_gid'];
$arr['deny_cid'] = $item['deny_cid'];
@@ -158,7 +161,7 @@ EOT;
if((! $blocktags) && (! stristr($item['tag'], ']' . $term . '[' ))) {
q("update item set tag = '%s' where id = %d limit 1",
- dbesc($item['tag'] . (strlen($item['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?search=' . $term . ']'. $term . '[/url]'),
+ dbesc($item['tag'] . (strlen($item['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?tag=' . $term . ']'. $term . '[/url]'),
intval($item['id'])
);
}
@@ -174,7 +177,7 @@ EOT;
);
if(count($x) && !$x[0]['blocktags'] && (! stristr($r[0]['tag'], ']' . $term . '['))) {
q("update item set tag = '%s' where id = %d limit 1",
- dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?search=' . $term . ']'. $term . '[/url]'),
+ dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . $a->get_baseurl() . '/search?tag=' . $term . ']'. $term . '[/url]'),
intval($r[0]['id'])
);
}