From 2eaf359bcdee9c74098c35ebfddaa5f6870b0907 Mon Sep 17 00:00:00 2001 From: Barbara Pitt Date: Sat, 26 Dec 2020 16:23:59 -0600 Subject: [PATCH] issue#35 - lookahead regex bug on quotes and crossboard quotes --- inc/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index b77ad54b..736b4892 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -2017,7 +2017,7 @@ function markup(&$body, $track_cites = false, $op = false) { print_err("Cites BEGIN"); // Cites - if (isset($board) && preg_match_all('/(^|\s)>>(\d+?)([\s,.)?]|$)/m', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { + if (isset($board) && preg_match_all('/(^|\s)>>(\d+?)((?=[\s,.)?!])|$)/m', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { if (count($cites[0]) > $config['max_cites']) { error($config['error']['toomanycites']); } @@ -2067,7 +2067,7 @@ function markup(&$body, $track_cites = false, $op = false) { print_err("Cross board linking BEGIN"); // Cross-board linking - if (preg_match_all('/(^|\s)>>>\/(' . $config['board_regex'] . 'f?)\/(\d+)?([\s,.)?]|$)/um', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { + if (preg_match_all('/(^|\s)>>>\/(' . $config['board_regex'] . 'f?)\/(\d+)?((?=[\s,.)?!])|$)/um', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) { if (count($cites[0]) > $config['max_cites']) { error($config['error']['toomanycross']); }