mirror of
https://github.com/friendica/friendica
synced 2025-04-29 23:44:22 +02:00
Remove useless rawurlencode calls for building hashtag bbcode
- Fix some formatting
This commit is contained in:
parent
540321d0aa
commit
4874f7f8ab
7 changed files with 25 additions and 25 deletions
|
@ -2448,15 +2448,15 @@ class Item extends BaseObject
|
|||
|
||||
$basetag = str_replace('_',' ',substr($tag,1));
|
||||
|
||||
$newtag = '#[url=' . System::baseUrl() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
|
||||
$newtag = '#[url=' . System::baseUrl() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
|
||||
|
||||
$item["body"] = str_replace($tag, $newtag, $item["body"]);
|
||||
|
||||
if (!stristr($item["tag"], "/search?tag=" . $basetag . "]" . $basetag . "[/url]")) {
|
||||
if (strlen($item["tag"])) {
|
||||
$item["tag"] = ','.$item["tag"];
|
||||
$item["tag"] = ',' . $item["tag"];
|
||||
}
|
||||
$item["tag"] = $newtag.$item["tag"];
|
||||
$item["tag"] = $newtag . $item["tag"];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -266,25 +266,25 @@ class Term
|
|||
$tag["url"] = $searchpath . $tag["term"];
|
||||
}
|
||||
|
||||
$orig_tag = $tag["url"];
|
||||
$orig_tag = $tag['url'];
|
||||
|
||||
$author = ['uid' => 0, 'id' => $item['author-id'],
|
||||
'network' => $item['author-network'], 'url' => $item['author-link']];
|
||||
$tag["url"] = Contact::magicLinkByContact($author, $tag['url']);
|
||||
$tag['url'] = Contact::magicLinkByContact($author, $tag['url']);
|
||||
|
||||
if ($tag["type"] == TERM_HASHTAG) {
|
||||
if ($orig_tag != $tag["url"]) {
|
||||
$item['body'] = str_replace($orig_tag, $tag["url"], $item['body']);
|
||||
if ($tag['type'] == TERM_HASHTAG) {
|
||||
if ($orig_tag != $tag['url']) {
|
||||
$item['body'] = str_replace($orig_tag, $tag['url'], $item['body']);
|
||||
}
|
||||
|
||||
$return['hashtags'][] = "#<a href=\"" . $tag["url"] . "\" target=\"_blank\">" . $tag["term"] . "</a>";
|
||||
$prefix = "#";
|
||||
} elseif ($tag["type"] == TERM_MENTION) {
|
||||
$return['mentions'][] = "@<a href=\"" . $tag["url"] . "\" target=\"_blank\">" . $tag["term"] . "</a>";
|
||||
$prefix = "@";
|
||||
$return['hashtags'][] = '#<a href="' . $tag['url'] . '" target="_blank">' . $tag['term'] . '</a>';
|
||||
$prefix = '#';
|
||||
} elseif ($tag['type'] == TERM_MENTION) {
|
||||
$return['mentions'][] = '@<a href="' . $tag['url'] . '" target="_blank">' . $tag['term'] . '</a>';
|
||||
$prefix = '@';
|
||||
}
|
||||
|
||||
$return['tags'][] = $prefix . "<a href=\"" . $tag["url"] . "\" target=\"_blank\">" . $tag["term"] . "</a>";
|
||||
$return['tags'][] = $prefix . '<a href="' . $tag['url'] . '" target="_blank">' . $tag['term'] . '</a>';
|
||||
}
|
||||
DBA::close($taglist);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue