jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/400238 )
Change subject: Update comments on string validators
......................................................................
Update comments on string validators
It appears the regex has been updated several times since the comment
was written. Hopefully this is more correct.
Change-Id: I1dc87a8c71c23a0ae9da80a27cc1b50c16c04147
---
M repo/includes/ValidatorBuilders.php
M repo/includes/Validators/TermValidatorFactory.php
2 files changed, 4 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
Thiemo Kreuz (WMDE): Looks good to me, approved
diff --git a/repo/includes/ValidatorBuilders.php
b/repo/includes/ValidatorBuilders.php
index d52a513..c20382b 100644
--- a/repo/includes/ValidatorBuilders.php
+++ b/repo/includes/ValidatorBuilders.php
@@ -184,7 +184,8 @@
$validators[] = new TypeValidator( 'string' );
//TODO: validate UTF8 (here and elsewhere)
$validators[] = new StringLengthValidator( 1, $maxLength,
'mb_strlen' );
- $validators[] = new RegexValidator( '/^\s|[\v\t]|\s$/u', true
); // no leading/trailing whitespace, no line breaks.
+ // no leading/trailing whitespace, no tab or vertical
whitespace, no line breaks.
+ $validators[] = new RegexValidator( '/^\s|[\v\t]|\s$/u', true );
return $validators;
}
diff --git a/repo/includes/Validators/TermValidatorFactory.php
b/repo/includes/Validators/TermValidatorFactory.php
index 6fd3bf3..c31288a 100644
--- a/repo/includes/Validators/TermValidatorFactory.php
+++ b/repo/includes/Validators/TermValidatorFactory.php
@@ -128,7 +128,8 @@
$validators = [];
$validators[] = new TypeValidator( 'string' );
$validators[] = new StringLengthValidator( 1, $this->maxLength,
'mb_strlen' );
- $validators[] = new RegexValidator( '/^\s|[\v\t]|\s$/u', true
); // no leading/trailing whitespace, no line breaks.
+ // no leading/trailing whitespace, no tab or vertical
whitespace, no line breaks.
+ $validators[] = new RegexValidator( '/^\s|[\v\t]|\s$/u', true );
return $validators;
}
--
To view, visit https://gerrit.wikimedia.org/r/400238
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1dc87a8c71c23a0ae9da80a27cc1b50c16c04147
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Thiemo Kreuz (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits