Merge pull request #6184 from MrPetovan/task/normalize-bbcode-hashtags

Normalize BBCode hashtags links
This commit is contained in:
Michael Vogel 2018-11-24 13:14:50 +01:00 committed by GitHub
commit 42a3610a79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 44 additions and 35 deletions

View file

@ -97,7 +97,7 @@ function add_page_info_data(array $data, $no_photos = false)
/// @TODO make a positive list of allowed characters
$hashtag = str_replace([" ", "+", "/", ".", "#", "'", "", "`", "(", ")", "", ""],
["", "", "", "", "", "", "", "", "", "", "", ""], $keyword);
$hashtags .= "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url] ";
$hashtags .= "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url] ";
}
}
@ -148,7 +148,7 @@ function add_page_keywords($url, $photo = "", $keywords = false, $keyword_blackl
$tags .= ", ";
}
$tags .= "#[url=" . System::baseUrl() . "/search?tag=" . rawurlencode($hashtag) . "]" . $hashtag . "[/url]";
$tags .= "#[url=" . System::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url]";
}
}