jenkins-bot has submitted this change and it was merged.

Change subject: abstract utf8 validation fallback
......................................................................


abstract utf8 validation fallback

Language class had a code snippet to verify whether a text is valid
UTF-8 though that could not be used from another place. The snippet use
mb_check_encoding() and fallback to some regex whenever mbstring is not
available.

* introduce StringUtils::isUtf8() which is mostly code moved out of the
  language class.
* Enhance regex readability by using an expanded regex (//x)
* Made the regex to recognize longer sequences
* Add some unit tests to the mbstring and the PHP native implementation
* An optional second parameter can be passed to isUtf8() to force the
  use of our PHP implementation. This is used for unit testing.

Change-Id: I4cf4dfe2eb02f046db1726f4654ba649e01419f2
---
M includes/StringUtils.php
M languages/Language.php
A tests/phpunit/includes/StringUtilsTest.php
3 files changed, 188 insertions(+), 13 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified; Looks good to me, but someone else must approve


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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4cf4dfe2eb02f046db1726f4654ba649e01419f2
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Lupo <lupo.bugzi...@gmail.com>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to