forked from friendica/friendica-addons
Merge pull request #776 from MrPetovan/task/normalize-bbcode-hashtags
[various] Remove useless rawurlencode calls
This commit is contained in:
commit
bf587a8308
|
@ -1534,7 +1534,7 @@ function statusnet_convertmsg(App $a, $body, $no_tags = false)
|
||||||
if ($mtch[1] == "#") {
|
if ($mtch[1] == "#") {
|
||||||
// Replacing the hash tags that are directed to the GNU Social server with internal links
|
// Replacing the hash tags that are directed to the GNU Social server with internal links
|
||||||
$snhash = "#[url=" . $mtch[2] . "]" . $mtch[3] . "[/url]";
|
$snhash = "#[url=" . $mtch[2] . "]" . $mtch[3] . "[/url]";
|
||||||
$frdchash = '#[url=' . $a->getBaseURL() . '/search?tag=' . rawurlencode($mtch[3]) . ']' . $mtch[3] . '[/url]';
|
$frdchash = '#[url=' . $a->getBaseURL() . '/search?tag=' . $mtch[3] . ']' . $mtch[3] . '[/url]';
|
||||||
$body = str_replace($snhash, $frdchash, $body);
|
$body = str_replace($snhash, $frdchash, $body);
|
||||||
|
|
||||||
$str_tags .= $frdchash;
|
$str_tags .= $frdchash;
|
||||||
|
|
|
@ -1201,7 +1201,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
|
||||||
$tags_arr = [];
|
$tags_arr = [];
|
||||||
|
|
||||||
foreach ($item->entities->hashtags AS $hashtag) {
|
foreach ($item->entities->hashtags AS $hashtag) {
|
||||||
$url = '#[url=' . $a->getBaseURL() . '/search?tag=' . rawurlencode($hashtag->text) . ']' . $hashtag->text . '[/url]';
|
$url = '#[url=' . $a->getBaseURL() . '/search?tag=' . $hashtag->text . ']' . $hashtag->text . '[/url]';
|
||||||
$tags_arr['#' . $hashtag->text] = $url;
|
$tags_arr['#' . $hashtag->text] = $url;
|
||||||
$body = str_replace('#' . $hashtag->text, $url, $body);
|
$body = str_replace('#' . $hashtag->text, $url, $body);
|
||||||
}
|
}
|
||||||
|
@ -1332,7 +1332,7 @@ function twitter_expand_entities(App $a, $body, $item, $picture)
|
||||||
}
|
}
|
||||||
|
|
||||||
$basetag = str_replace('_', ' ', substr($tag, 1));
|
$basetag = str_replace('_', ' ', substr($tag, 1));
|
||||||
$url = '#[url=' . $a->getBaseURL() . '/search?tag=' . rawurlencode($basetag) . ']' . $basetag . '[/url]';
|
$url = '#[url=' . $a->getBaseURL() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
|
||||||
$body = str_replace($tag, $url, $body);
|
$body = str_replace($tag, $url, $body);
|
||||||
$tags_arr['#' . $basetag] = $url;
|
$tags_arr['#' . $basetag] = $url;
|
||||||
} elseif (strpos($tag, '@') === 0) {
|
} elseif (strpos($tag, '@') === 0) {
|
||||||
|
|
Loading…
Reference in a new issue