From 2da6c95aa55ce6ed7cc44a06899acd85020867c0 Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 16 Feb 2025 18:07:32 +0100 Subject: [PATCH 1/2] functions.php: remove unused parameter from markup --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/functions.php b/inc/functions.php index 66cd6fa7..90079561 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2069,7 +2069,7 @@ function remove_modifiers($body) { return preg_replace('@(.+?)@usm', '', $body); } -function markup(&$body, $track_cites = false, $op = false) { +function markup(&$body, $track_cites = false) { global $board, $config, $markup_urls; $modifiers = extract_modifiers($body); From c73a893e542ab5f91502605c57a77e2ed893919a Mon Sep 17 00:00:00 2001 From: Zankaria Date: Mon, 17 Feb 2025 00:31:59 +0100 Subject: [PATCH 2/2] functions.php: strikethrough bad citations --- inc/functions.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 90079561..def00287 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2168,12 +2168,15 @@ function markup(&$body, $track_cites = false) { link_for(array('id' => $cite, 'thread' => $cited_posts[$cite])) . '#' . $cite . '">' . '>>' . $cite . ''; + } else { + $replacement = ">>$cite"; + } - $body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[3][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0])); - $skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[3][0]) - mb_strlen($matches[0][0]); + $body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[3][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0])); + $skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[3][0]) - mb_strlen($matches[0][0]); - if ($track_cites && $config['track_cites']) - $tracked_cites[] = array($board['uri'], $cite); + if ($track_cites && $config['track_cites']) { + $tracked_cites[] = array($board['uri'], $cite); } } }