aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-11-17 13:40:27 +0100
committerFabio Comuni <fabrix.xm@gmail.com>2011-11-17 13:40:27 +0100
commit844a36e2b6c9cd8e934b57b7d56b7a9863f12929 (patch)
tree3ba5f23865643ff8c660fb9c9a9eeb44327b8a1b /include/items.php
parent02281be0c3b19bcab3ae3a96475846104af11e92 (diff)
parentc9846b745dfe2a4c20ffe4e1f48bb18da3886fd4 (diff)
downloadvolse-hubzilla-844a36e2b6c9cd8e934b57b7d56b7a9863f12929.tar.gz
volse-hubzilla-844a36e2b6c9cd8e934b57b7d56b7a9863f12929.tar.bz2
volse-hubzilla-844a36e2b6c9cd8e934b57b7d56b7a9863f12929.zip
Merge remote-tracking branch 'friendica/master'
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 b8e258d3f..ecf19a86e 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1469,10 +1469,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'])
);
}
@@ -2011,15 +2012,17 @@ function local_delivery($importer,$data) {
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'])
);
}