diff options
author | Andreas Gohr <andi@splitbrain.org> | 2008-03-09 18:35:38 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2008-03-09 18:35:38 +0100 |
commit | 838fc1b345833427b6e92980675c04efe5969257 (patch) | |
tree | ca8085c9aad848a0286870d15c76728d74a712e0 | |
parent | aac682fbd0885f612fad6f82d8ac71573e80786f (diff) | |
download | rpg-838fc1b345833427b6e92980675c04efe5969257.tar.gz rpg-838fc1b345833427b6e92980675c04efe5969257.tar.bz2 |
make sure there are no leading or trailing pipes on search highlight regexp
darcs-hash:20080309173538-7ad00-07893a25205632ff4bc5d8b90595e7d1c9e49ff4.gz
-rw-r--r-- | inc/html.php | 1 |
1 files changed, 1 insertions, 0 deletions
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); |