functions.php: add crossboard strikethrough for invalid cites

This commit is contained in:
Zankaria 2025-04-23 19:52:10 +02:00
parent f2d0ac7341
commit 439730f216

View file

@ -2296,21 +2296,23 @@ function markup(&$body, $track_cites = false) {
}
$body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[4][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0]));
$skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[4][0]) - mb_strlen($matches[0][0]);
if ($track_cites && $config['track_cites'])
$tracked_cites[] = array($_board, $cite);
} else {
$replacement = "<s>&gt;&gt;&gt;/$_board/$cite</s>";
}
} elseif(isset($crossboard_indexes[$_board])) {
$replacement = '<a href="' . $crossboard_indexes[$_board] . '">' .
'&gt;&gt;&gt;/' . $_board . '/' .
'</a>';
} else {
$replacement = "<s>&gt;&gt;&gt;/$_board/$cite</s>";
}
$body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[4][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0]));
$skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[4][0]) - mb_strlen($matches[0][0]);
}
}
}
$tracked_cites = array_unique($tracked_cites, SORT_REGULAR);