Daniel Kinzler has uploaded a new change for review. https://gerrit.wikimedia.org/r/116751
Change subject: Check leading and trailing whitespace ...................................................................... Check leading and trailing whitespace Change-Id: I16f9fbc7214cc4079d5bbabb1e937ba8e71defdd --- M lib/tests/phpunit/WikibaseDataTypeBuildersTest.php 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/51/116751/1 diff --git a/lib/tests/phpunit/WikibaseDataTypeBuildersTest.php b/lib/tests/phpunit/WikibaseDataTypeBuildersTest.php index 7063ed0..0582ff1 100644 --- a/lib/tests/phpunit/WikibaseDataTypeBuildersTest.php +++ b/lib/tests/phpunit/WikibaseDataTypeBuildersTest.php @@ -68,7 +68,8 @@ array( 'commonsMedia', new StringValue( 'Foo/bar.jpg' ), false, 'illegal character: slash' ), array( 'commonsMedia', new StringValue( 'Foo\bar.jpg' ), false, 'illegal character: backslash' ), array( 'commonsMedia', new StringValue( 'Äöü.jpg' ), true, 'Unicode support' ), - array( 'commonsMedia', new StringValue( ' Foo.jpg ' ), false, 'Untrimmed input is forbidden' ), + array( 'commonsMedia', new StringValue( ' Foo.jpg' ), false, 'media name with leading space' ), + array( 'commonsMedia', new StringValue( 'Foo.jpg ' ), false, 'media name with trailing space' ), //string array( 'string', 'Foo', false, 'StringValue expected, string supplied' ), @@ -78,7 +79,8 @@ array( 'string', new StringValue( 'Äöü' ), true, 'Unicode support' ), array( 'string', new StringValue( str_repeat('x', 390) ), true, 'long, but not too long' ), array( 'string', new StringValue( str_repeat('x', 401) ), false, 'too long' ), - array( 'string', new StringValue( ' Foo ' ), false, 'Untrimmed' ), + array( 'string', new StringValue( ' Foo' ), false, 'string with leading space' ), + array( 'string', new StringValue( 'Foo ' ), false, 'string with trailing space' ), //time array( 'time', 'Foo', false, 'TimeValue expected, string supplied' ), @@ -153,6 +155,9 @@ array( 'url', new StringValue( 'javascript:alert("evil")' ), false, 'JavaScript URL' ), array( 'url', new StringValue( 'http://' ), false, 'bad http URL' ), array( 'url', new StringValue( 'http://' . str_repeat('x', 505) ), false, 'URL too long' ), + + array( 'url', new StringValue( ' http://acme.com' ), false, 'URL with leading space' ), + array( 'url', new StringValue( 'http://acme.com ' ), false, 'URL with trailing space' ), ); if ( defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES ) { -- To view, visit https://gerrit.wikimedia.org/r/116751 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16f9fbc7214cc4079d5bbabb1e937ba8e71defdd Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Daniel Kinzler <daniel.kinz...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits