diff options
-rw-r--r-- | inc/common.php | 9 | ||||
-rw-r--r-- | inc/html.php | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/inc/common.php b/inc/common.php index 76540baee..24a8a1889 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1039,4 +1039,13 @@ function subscriber_addresslist($id){ return $emails; } +/** + * Removes quoting backslashes + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function unslash($string,$char="'"){ + return str_replace('\\'.$char,$char,$string); +} + //Setup VIM: ex: et ts=2 enc=utf-8 : diff --git a/inc/html.php b/inc/html.php index da27936e1..3078ff838 100644 --- a/inc/html.php +++ b/inc/html.php @@ -283,7 +283,7 @@ function html_hilight($html,$query){ $queries = preg_split ("/\s/",$query,-1,PREG_SPLIT_NO_EMPTY); foreach ($queries as $q){ $q = preg_quote($q,'/'); - $html = preg_replace("/((<[^>]*)|$q)/ie", '"\2"=="\1"? "\1":"<span class=\"search_hit\">\1</span>"', $html); + $html = preg_replace("/((<[^>]*)|$q)/ie", '"\2"=="\1"? unslash("\1"):"<span class=\"search_hit\">".unslash("\1")."</span>"', $html); } return $html; } |