From a0fed8ac0087b2df2ae74f037b7ffd679f86174e Mon Sep 17 00:00:00 2001 From: Andreas Gohr <andi@splitbrain.org> Date: Sun, 9 Mar 2008 18:48:10 +0100 Subject: [PATCH] more robust replacement for last highlight regexp fix darcs-hash:20080309174810-7ad00-16f8bee9e9ce13f6255e59de42685e49b3854bac.gz --- inc/html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/html.php b/inc/html.php index b2b76f2c7..a0ae0110d 100644 --- a/inc/html.php +++ b/inc/html.php @@ -265,7 +265,7 @@ function html_draft(){ function html_hilight($html,$regex){ // strip everything that's special except pipes: $regex = preg_replace('![\[\]()/\\\\?\.+*]+!','',$regex); - $regex = trim($regex,' |'); + $regex = join('|',array_filter(array_map('trim',explode('|',$regex)))); if ($regex === '') return $html; $html = preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html); -- GitLab