From e6258e07cc6b983f0280aae21c55808fb8597239 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 11 Sep 2005 23:08:01 +0200 Subject: fixed UTF-8 handling in Acronyms #478 darcs-hash:20050911210801-7ad00-f571ad2eeb07ce2e62ae55775b49c0e9be523166.gz --- inc/parser/parser.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'inc/parser') diff --git a/inc/parser/parser.php b/inc/parser/parser.php index 991031a30..22f836709 100644 --- a/inc/parser/parser.php +++ b/inc/parser/parser.php @@ -623,11 +623,9 @@ class Doku_Parser_Mode_acronym extends Doku_Parser_Mode { } function preConnect() { - $sep = ''; - foreach ( $this->acronyms as $acronym ) { - $this->pattern .= $sep.'(?<=\b)'.Doku_Lexer_Escape($acronym).'(?=\b)'; - $sep = '|'; - } + $bound = '[\x00-\x2f\x3a-\x3f\x5b-\x7f]'; + $acronyms = array_map('Doku_Lexer_Escape',$this->acronyms); + $this->pattern = '(?<='.$bound.')(?:'.join('|',$acronyms).')(?='.$bound.')'; } function connectTo($mode) { -- cgit v1.2.3