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

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(-)

Approvals:
  MarkTraceur: Looks good to me, approved
  jenkins-bot: Verified



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: merged
Gerrit-Change-Id: I6a8733bfb2e63a1284422bd9da7efadc26c26bae
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CommonsMetadata
Gerrit-Branch: master
Gerrit-Owner: GergÅ‘ Tisza <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to