Thiemo Mättig (WMDE) has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/338740 )

Change subject: Block all vertical whitespace in string validators
......................................................................

Block all vertical whitespace in string validators

The \v shortcut is supported since PHP 5.2. See
http://www.pcre.org/original/doc/html/pcrepattern.html
for a list of all characters it contains. Yes, I'm sure we want to
block all of them.

Change-Id: Icdad7a2cfc81eab9756f282f2176d61c27629ed4
---
M repo/includes/ValidatorBuilders.php
M repo/includes/Validators/TermValidatorFactory.php
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/40/338740/1

diff --git a/repo/includes/ValidatorBuilders.php 
b/repo/includes/ValidatorBuilders.php
index 22da4b7..d1aa613 100644
--- a/repo/includes/ValidatorBuilders.php
+++ b/repo/includes/ValidatorBuilders.php
@@ -158,7 +158,7 @@
                $validators[] = new TypeValidator( 'string' );
                //TODO: validate UTF8 (here and elsewhere)
                $validators[] = new StringLengthValidator( 1, $maxLength, 
'mb_strlen' );
-               $validators[] = new RegexValidator( '/^\s|[\r\n\t]|\s$/', true 
); // no leading/trailing whitespace, no line breaks.
+               $validators[] = new RegexValidator( '/^\s|\v|\s$/', true ); // 
no leading/trailing whitespace, no line breaks.
 
                return $validators;
        }
diff --git a/repo/includes/Validators/TermValidatorFactory.php 
b/repo/includes/Validators/TermValidatorFactory.php
index 98b4b4b..f669fb5 100644
--- a/repo/includes/Validators/TermValidatorFactory.php
+++ b/repo/includes/Validators/TermValidatorFactory.php
@@ -128,7 +128,7 @@
                $validators = array();
                $validators[] = new TypeValidator( 'string' );
                $validators[] = new StringLengthValidator( 1, $this->maxLength, 
'mb_strlen' );
-               $validators[] = new RegexValidator( '/^\s|[\r\n\t]|\s$/', true 
); // no leading/trailing whitespace, no line breaks.
+               $validators[] = new RegexValidator( '/^\s|\v|\s$/', true ); // 
no leading/trailing whitespace, no line breaks.
 
                return $validators;
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdad7a2cfc81eab9756f282f2176d61c27629ed4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to