mirror of
https://github.com/friendica/friendica
synced 2025-04-28 17:04:23 +02:00
Merge pull request #6184 from MrPetovan/task/normalize-bbcode-hashtags
Normalize BBCode hashtags links
This commit is contained in:
commit
42a3610a79
8 changed files with 44 additions and 35 deletions
|
@ -350,7 +350,7 @@ class Feed {
|
|||
$tags .= ', ';
|
||||
}
|
||||
|
||||
$taglink = "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url]";
|
||||
$taglink = "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url]";
|
||||
$tags .= $taglink;
|
||||
}
|
||||
|
||||
|
|
|
@ -634,15 +634,15 @@ class OStatus
|
|||
if ($categories) {
|
||||
foreach ($categories as $category) {
|
||||
foreach ($category->attributes as $attributes) {
|
||||
if ($attributes->name == "term") {
|
||||
if ($attributes->name == 'term') {
|
||||
$term = $attributes->textContent;
|
||||
if (!empty($item["tag"])) {
|
||||
$item["tag"] .= ',';
|
||||
if (!empty($item['tag'])) {
|
||||
$item['tag'] .= ',';
|
||||
} else {
|
||||
$item["tag"] = '';
|
||||
$item['tag'] = '';
|
||||
}
|
||||
|
||||
$item["tag"] .= "#[url=".System::baseUrl()."/search?tag=".$term."]".$term."[/url]";
|
||||
$item['tag'] .= '#[url=' . System::baseUrl() . '/search?tag=' . $term . ']' . $term . '[/url]';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue