From 808551e3748c0e77925d74031f348cdb2c07b7c1 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 26 May 2009 09:30:13 +0200 Subject: don't pass function return as reference in html_hilight() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ignore-this: 19a8e8cbdbafea2268a31a08a65f4e05 This was actually reported [1] as a bug elsewhere, but really should be fixed in DokuWiki and now is. [1] https://www.projectzero.org/bugzilla/show_bug.cgi?id†71 darcs-hash:20090526073013-7ad00-90c0bee83ebc6c9c3e33b2a58b8d0a17d828f748.gz --- inc/html.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/html.php b/inc/html.php index b1e755cd3..86c926cf5 100644 --- a/inc/html.php +++ b/inc/html.php @@ -265,7 +265,8 @@ function html_draft(){ * @author Harry Fuecks */ function html_hilight($html,$phrases){ - $regex = join('|',array_map('preg_quote_cb',array_filter((array) $phrases))); + $phrases = array_filter((array) $phrases); + $regex = join('|',array_map('preg_quote_cb',$phrases)); if ($regex === '') return $html; $html = preg_replace_callback("/((<[^>]*)|$regex)/ui",'html_hilight_callback',$html); -- cgit v1.2.3