BBcode, Tags - changes for #pullrequestreview-197771905

2022.09-rc
Peter Liebetrau 2019-01-29 22:34:28 +01:00
rodzic 5080778ea6
commit c3e5c77eb3
1 zmienionych plików z 7 dodań i 9 usunięć

Wyświetl plik

@ -2441,22 +2441,20 @@ class Item extends BaseObject
"#$2", $item["body"]);
foreach ($tags as $tag) {
if ((strpos($tag, '#') !== 0) || strpos($tag, '[url=')) {
if ((strpos($tag, '#') !== 0) || strpos($tag, '[url=') || $tag[1] == '#') {
continue;
}
$basetag = str_replace('_',' ',substr($tag,1));
if($basetag[0] != '#') {
$newtag = '#[url=' . System::baseUrl() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
$newtag = '#[url=' . System::baseUrl() . '/search?tag=' . $basetag . ']' . $basetag . '[/url]';
$item["body"] = str_replace($tag, $newtag, $item["body"]);
$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"] = $newtag . $item["tag"];
if (!stristr($item["tag"], "/search?tag=" . $basetag . "]" . $basetag . "[/url]")) {
if (strlen($item["tag"])) {
$item["tag"] = ',' . $item["tag"];
}
$item["tag"] = $newtag . $item["tag"];
}
}