aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2011-11-18 22:04:41 -0800
committerfriendica <info@friendica.com>2011-11-18 22:04:41 -0800
commitfd4fe24406edb277814c7a45a6094a8eec0850d7 (patch)
tree7db5bceb30a569b035c600313a9dbbf66b14abac /include/items.php
parent485f97b3d8937f219e2b9f3c662ee0e1966130eb (diff)
parent6893df991edfe971871a5db45055b40b871a7a4f (diff)
downloadvolse-hubzilla-fd4fe24406edb277814c7a45a6094a8eec0850d7.tar.gz
volse-hubzilla-fd4fe24406edb277814c7a45a6094a8eec0850d7.tar.bz2
volse-hubzilla-fd4fe24406edb277814c7a45a6094a8eec0850d7.zip
Merge branch 'master' into groups
Diffstat (limited to 'include/items.php')
-rw-r--r--include/items.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/items.php b/include/items.php
index 7ab7eeaa4..72c1a8b32 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1529,10 +1529,11 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
continue;
// extract tag, if not duplicate, add to parent item
- if($xo->content) {
- if(! (stristr($r[0]['tag'],trim($xo->content)))) {
+ if($xo->id && $xo->content) {
+ $newtag = '#[url=' . $xo->id . ']'. $xo->content . '[/url]';
+ if(! (stristr($r[0]['tag'],$newtag))) {
q("UPDATE item SET tag = '%s' WHERE id = %d LIMIT 1",
- dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . $xo->id . ']'. $xo->content . '[/url]'),
+ dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . $newtag),
intval($r[0]['id'])
);
}
@@ -2084,15 +2085,17 @@ dbg(0);
if(($xt->type == ACTIVITY_OBJ_NOTE) && ($xt->id == $r[0]['uri'])) {
// extract tag, if not duplicate, and this user allows tags, add to parent item
- if($xo->content) {
- if(! (stristr($r[0]['tag'],trim($xo->content)))) {
+ if($xo->id && $xo->content) {
+ $newtag = '#[url=' . $xo->id . ']'. $xo->content . '[/url]';
+
+ if(! (stristr($r[0]['tag'],$newtag))) {
$i = q("SELECT `blocktags` FROM `user` where `uid` = %d LIMIT 1",
intval($importer['importer_uid'])
);
if(count($i) && ! ($i[0]['blocktags'])) {
q("UPDATE item SET tag = '%s' WHERE id = %d LIMIT 1",
- dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . '#[url=' . $xo->id . ']'. $xo->content . '[/url]'),
+ dbesc($r[0]['tag'] . (strlen($r[0]['tag']) ? ',' : '') . $newtag),
intval($r[0]['id'])
);
}