Aleksey Bekh-Ivanov (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/344600 )

Change subject: Forgotten unicode regex flag
......................................................................

Forgotten unicode regex flag

Bug: T161263
Change-Id: Iaa90f4faed62910cd69f472ea7ab8b602797a310
---
M src/Validators/LexemeValidatorFactory.php
M tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php
2 files changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseLexeme 
refs/changes/00/344600/1

diff --git a/src/Validators/LexemeValidatorFactory.php 
b/src/Validators/LexemeValidatorFactory.php
index 360140d..c626872 100644
--- a/src/Validators/LexemeValidatorFactory.php
+++ b/src/Validators/LexemeValidatorFactory.php
@@ -58,7 +58,7 @@
                        [
                                new TypeValidator( 'string' ),
                                new StringLengthValidator( 1, 
$this->maxTermLength, 'mb_strlen' ),
-                               new RegexValidator( '/^\s|[\v\t]|\s$/', true ),
+                               new RegexValidator( '/^\s|[\v\t]|\s$/u', true ),
                        ],
                        true
                );
diff --git a/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php 
b/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php
index 090b979..cec5b17 100644
--- a/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php
+++ b/tests/phpunit/mediawiki/Validators/LexemeValidatorFactoryTest.php
@@ -77,6 +77,7 @@
        public function lemmaTermProvider() {
                return [
                        'valid' => [ true, 'foo' ],
+                       'cyrillic "х"' => [ true, 'х' ],
                        'not a string' => [ false, false ],
                        'empty' => [ false, '' ],
                        'exceeds maxLength of 10' => [ false, 'foooooooooo' ],

-- 
To view, visit https://gerrit.wikimedia.org/r/344600
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaa90f4faed62910cd69f472ea7ab8b602797a310
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Aleksey Bekh-Ivanov (WMDE) <aleksey.bekh-iva...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to