jenkins-bot has submitted this change and it was merged. (
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(-)
Approvals:
Daniel Kinzler: Looks good to me, approved
Jonas Kress (WMDE): Looks good to me, approved
jenkins-bot: Verified
Thiemo Mättig (WMDE): Looks good to me, approved
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, 'foo' ],
--
To view, visit https://gerrit.wikimedia.org/r/344600
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa90f4faed62910cd69f472ea7ab8b602797a310
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/WikibaseLexeme
Gerrit-Branch: master
Gerrit-Owner: Aleksey Bekh-Ivanov (WMDE)
Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE)
Gerrit-Reviewer: Daniel Kinzler
Gerrit-Reviewer: Jonas Kress (WMDE)
Gerrit-Reviewer: Ladsgroup
Gerrit-Reviewer: Thiemo Mättig (WMDE)
Gerrit-Reviewer: jenkins-bot <>
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits