]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #1853 matching UTF8 characters in usernames
authorcash <cash.costello@gmail.com>
Sat, 4 Feb 2012 22:08:05 +0000 (17:08 -0500)
committercash <cash.costello@gmail.com>
Sat, 4 Feb 2012 22:08:05 +0000 (17:08 -0500)
mod/thewire/start.php
mod/thewire/tests/regex.php

index 202e3d1d62ee31f6c7805dba7dc4048ce54f5b5a..fdaf91355bb03d806ca42ae3e244076d7f8a73c1 100644 (file)
@@ -219,7 +219,7 @@ function thewire_filter($text) {
 
        // usernames
        $text = preg_replace(
-                               '/(^|[^\w])@([\w.]+)/',
+                               '/(^|[^\w])@([\p{L}\p{Nd}._]+)/u',
                                '$1<a href="' . $CONFIG->wwwroot . 'thewire/owner/$2">@$2</a>',
                                $text);
 
index f5487a422c283f89bc1ac132540d54cae50db8ea..c73e06bdc4570ed69d8b58d9ee570f6b4153e84f 100644 (file)
@@ -127,6 +127,12 @@ class TheWireRegexTest extends ElggCoreUnitTest {
                $expected = "test (" . $this->getUserWireLink('user') . ") test";
                $result = thewire_filter($text);
                $this->assertEqual($result, $expected);
+
+               // utf8 characters
+               $text = "@tyúkanyó";
+               $expected = $this->getUserWireLink('tyúkanyó');
+               $result = thewire_filter($text);
+               $this->assertEqual($result, $expected);
        }
 
        /**