Gergő Tisza has uploaded a new change for review.
https://gerrit.wikimedia.org/r/93985
Change subject: Trim license shortnames
......................................................................
Trim license shortnames
Apparently some templates put a \n to the end.
Change-Id: I6a8733bfb2e63a1284422bd9da7efadc26c26bae
---
M CommonsMetadata_body.php
1 file changed, 2 insertions(+), 2 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CommonsMetadata
refs/changes/85/93985/1
diff --git a/CommonsMetadata_body.php b/CommonsMetadata_body.php
index ee6dc46..8caa875 100755
--- a/CommonsMetadata_body.php
+++ b/CommonsMetadata_body.php
@@ -25,7 +25,7 @@
'cc-by-sa-2.5' => 'cc-by-sa-2.5',
'cc-by-3.0' => 'cc-by-3.0',
'cc-by-sa-3.0' => 'cc-by-sa-3.0',
- 'cc-by-sa-3.0-migrated' => 'cc-by-sa-3.0',
+// 'cc-by-sa-3.0-migrated' => 'cc-by-sa-3.0', // no such shortname
// 'cc-pd' => 'cc-pd', // no shortname
'cc0' => 'cc-zero',
);
@@ -175,7 +175,7 @@
* @see
https://commons.wikimedia.org/wiki/Commons:Machine-readable_data#Machine_readable_data_set_by_license_templates
*/
protected static function getLicenseFromShortname( $shortName ) {
- $shortName = strtolower( $shortName );
+ $shortName = strtolower( trim( $shortName ) );
if ( isset( self::$licenses[$shortName] ) ) {
return self::$licenses[$shortName];
}
--
To view, visit https://gerrit.wikimedia.org/r/93985
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a8733bfb2e63a1284422bd9da7efadc26c26bae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommonsMetadata
Gerrit-Branch: master
Gerrit-Owner: Gergő Tisza <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits