Merge pull request #8302 from annando/allowed-chars

Added characters to the disallowed hashtag characters
pull/8306/head
Philipp 2020-02-17 17:59:56 +01:00 zatwierdzone przez GitHub
commit d09b3f5bde
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 1 dodań i 2 usunięć

Wyświetl plik

@ -103,8 +103,7 @@ function add_page_info_data(array $data, $no_photos = false)
$hashtags = "\n";
foreach ($data["keywords"] as $keyword) {
/// @TODO make a positive list of allowed characters
$hashtag = str_replace([" ", "+", "/", ".", "#", "'", "", "`", "(", ")", "", ""],
["", "", "", "", "", "", "", "", "", "", "", ""], $keyword);
$hashtag = str_replace([' ', '+', '/', '.', '#', '@', "'", '"', '', '`', '(', ')', '„', '“'], '', $keyword);
$hashtags .= "#[url=" . DI::baseUrl() . "/search?tag=" . $hashtag . "]" . $hashtag . "[/url] ";
}
}