From b18cf97f7cd211ddd487d938760acaa059040ed7 Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Mon, 14 May 2018 23:13:08 +0000 Subject: [PATCH] Cleaning up the regexp for #69. --- Connections/database_functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Connections/database_functions.php b/Connections/database_functions.php index 02823cb..2f658ca 100644 --- a/Connections/database_functions.php +++ b/Connections/database_functions.php @@ -330,9 +330,9 @@ function highlightKeywords($text, $keyword) { $wordsAry = explode(" ", $keyword); $wordsCount = count($wordsAry); - // Using REGEXP so remove regex from search - $find = array('/\*/', '/\./', '/\$/', '/\^/', '/\?/', '/\+/', '/\[/', '/\]/', '/\|/', '/\(/', '/\)/', '/\,/', '/\{/', '/\}/', '/\:/', '/\\\/'); - $replace = array('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); + // Using REGEXP, this removes regex from search + $find = array('/[\*\.\$\^\?\+\[\]\|\(\)\,\{\}\:\\\]/'); + $replace = array(''); for($i=0;$i<$wordsCount;$i++) {