Warning in Search block when using a single parenthesis

0 confirmed 0 invalid Browser Info Environment
When using the search block and submitting a search query with one parenthesis, the following warning is issued:
PHP Warning: preg_match_all() [<a href='function.preg-match-all'>function.preg-match-all</a>]: Compilation failed: unmatched parentheses at offset 80 in /home/islam/public_html/cms/updates/concrete5.4.0.5/concrete/blocks/search/controller.php on line 33
This is because parenthesis are not removed from the $highlight variable used in the search $regex
Line 30 of /concrete/blocks/search/controller.php should be changed from:
$highlight = str_replace(array('"',"'","&quot;"),'',$highlight); // strip the quotes as they mess the regex
to
$highlight = str_replace(array('"',"'","&quot;",')','('),'',$highlight); // strip the quotes as they mess the regex

Maybe it should also include other unsafe regex characters.
This applies to the latest svn too (R1986)
okhayat
View Replies:

concrete5 Environment Information

# concrete5 Version
5.4.0.5

# concrete5 Packages
بدون

# concrete5 Overrides
blocks/kuwait_prayer_times, blocks/page_list, controllers/fatwa, controllers/avlibrary.php, controllers/library.php, controllers/mobile, css/doc.png, css/paper.gif, css/library-header.jpg, css/arrow.jpg, css/zip.png, css/pdf.png, languages/messages.mo, languages/ar_KW, single_pages/maintenance_mode.php, single_pages/jobs, single_pages/fatwa, single_pages/site-migration.php.old, single_pages/avlibrary.php, single_pages/job-request.php, single_pages/site-migration.php, single_pages/library-migration.php, single_pages/library.php, single_pages/mobile, themes/mobile, themes/awqaf_portal

# برنامج الخادم
Apache

# واجهة برمجة الخادم
cgi-fcgi

# إصدار PHP
5.2.12

# PHP Extensions
bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dom, exif, filter, ftp, gd, gettext, hash, iconv, imap, ionCube Loader, json, libxml, mbstring, mcrypt, mysql, mysqli, openssl, pcre, PDO, pdo_mysql, pdo_sqlite, posix, pspell, Reflection, session, SimpleXML, soap, sockets, SPL, SQLite, standard, suhosin, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, Zend Optimizer, zip, zlib.

# PHP Settings

Browser User-Agent String

Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/10.04 (lucid) Firefox/3.6.8