From 838fc1b345833427b6e92980675c04efe5969257 Mon Sep 17 00:00:00 2001
From: Andreas Gohr <andi@splitbrain.org>
Date: Sun, 9 Mar 2008 18:35:38 +0100
Subject: [PATCH] make sure there are no leading or trailing pipes on search
 highlight regexp

darcs-hash:20080309173538-7ad00-07893a25205632ff4bc5d8b90595e7d1c9e49ff4.gz
---
 inc/html.php | 1 +
 1 file changed, 1 insertion(+)

diff --git a/inc/html.php b/inc/html.php
index f382fa68a..b2b76f2c7 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -265,6 +265,7 @@ function html_draft(){
 function html_hilight($html,$regex){
   // strip everything that's special except pipes:
   $regex = preg_replace('![\[\]()/\\\\?\.+*]+!','',$regex);
+  $regex = trim($regex,' |');
 
   if ($regex === '') return $html;
   $html = preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html);
-- 
GitLab