Index: trunk/extensions/DoubleWiki/DoubleWiki_body.php |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | * Read the list of matched phrases and add tags to the html output. |
28 | 28 | */ |
29 | 29 | function addMatchingTags ( &$text, $lang ) { |
30 | | - $pattern = "/<div id=\"align-$lang\" style=\"display:none;\">\n*<pre>(.*?)<\/pre>\n*<\/div>/is"; |
| 30 | + $pattern = "/<div id=\"align-" . preg_quote( $lang, '/' ) . "\" style=\"display:none;\">\n*<pre>(.*?)<\/pre>\n*<\/div>/is"; |
31 | 31 | $m = array(); |
32 | 32 | if ( ! preg_match( $pattern, $text, $m ) ) { |
33 | 33 | return; |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | $items = array(); |
38 | 38 | preg_match_all( $line_pattern, $m[1], $items, PREG_SET_ORDER ); |
39 | 39 | foreach ( $items as $n => $i ) { |
40 | | - $text = str_replace( $i[1], "<span id=\"dw-$n\" title=\"{$i[2]}\"/>" . $i[1], $text ); |
| 40 | + $text = str_replace( $i[1], "<span id=\"dw-" . preg_quote( $n, '/' ) . "\" title=\"{$i[2]}\"/>" . $i[1], $text ); |
41 | 41 | } |
42 | 42 | } |
43 | 43 | |