From 23e0b4d11b812faf0b304d4e57034a4b0e245589 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Mon, 23 Nov 2015 15:51:24 -0500 Subject: [PATCH] trying another regex to remove extra spaces --- search.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/search.php b/search.php index 6a84b80..c25c697 100644 --- a/search.php +++ b/search.php @@ -73,12 +73,12 @@ } // Highlight matches - $context = nl2br(preg_replace('/'.str_replace('/', '\/', join('|', $terms)).'/i', '$0', $output)); - $noNewLine = preg_replace('/[\n\r]+/', '', $context); + $context = nl2br(preg_replace('/'.str_replace('/', '\/', join('|', $terms)).'/i', '$0', $output)); + $noExtraSpace = preg_replace('!\s+!', ' ', $context); ?>

- +

-- 2.17.1