]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
quote match terms
authorEvan Prodromou <evan@prodromou.name>
Fri, 18 Jul 2008 18:35:34 +0000 (14:35 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 18 Jul 2008 18:35:34 +0000 (14:35 -0400)
darcs-hash:20080718183534-84dde-a8cdb4cbcb3eb67152eb74179e3b00061e2287cf.gz

actions/peoplesearch.php

index 323065d7a9520b35136be10801aa0d4b62dd1e6d..f700cf46e70105cd5c8c1e46413533eba2fe98cd 100644 (file)
@@ -115,7 +115,8 @@ class PeoplesearchAction extends SearchAction {
        }
 
        function highlight($text, $terms) {
-               $pattern = '/('.implode('|',array_map('htmlspecialchars', $terms)).')/i';
+               $terms = array_map('preg_quote', array_map('htmlspecialchars', $terms));
+               $pattern = '/('.implode('|',$terms).')/i';
                $result = preg_replace($pattern, '<strong>\\1</strong>', htmlspecialchars($text));
                return $result;
        }