diff --git a/LinkTitles.body.php b/LinkTitles.body.php index 02a6a4b..a837eb3 100755 --- a/LinkTitles.body.php +++ b/LinkTitles.body.php @@ -104,8 +104,13 @@ global $wgLinkTitlesSmartMode; global $wgCapitalLinks; - ( $wgLinkTitlesWordStartOnly ) ? $wordStartDelim = '\b' : $wordStartDelim = ''; - ( $wgLinkTitlesWordEndOnly ) ? $wordEndDelim = '\b' : $wordEndDelim = ''; + // Use unicode character properties rather than \b escape sequences + // to detect whole words containing non-ASCII characters as well. + // Note that this requires the use of the '/u' switch, and you need + // to have PHP with a PCRE library that was compiled with + // --enable-unicode-properties + ( $wgLinkTitlesWordStartOnly ) ? $wordStartDelim = '(?= 0 ) && ( $count > 0 )) { break; @@ -227,7 +232,7 @@ // even indexes will point to text that is not enclosed by brackets $arr[$i] = preg_replace_callback( '/(?= 0 ) && ( $count > 0 )) { break;