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

Change subject: mw.DestinationChecker: Avoid exception when a file page without 
extension is returned
......................................................................


mw.DestinationChecker: Avoid exception when a file page without extension is 
returned

While files in MediaWiki must have an extension, pages in the File
namespace not associated with files may not have one.

Bug: T136237
Change-Id: If982f0fada2f4883f0537c748da0adc72e15d7f4
---
M resources/mw.DestinationChecker.js
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/resources/mw.DestinationChecker.js 
b/resources/mw.DestinationChecker.js
index 1b9bccb..ee99d7d 100644
--- a/resources/mw.DestinationChecker.js
+++ b/resources/mw.DestinationChecker.js
@@ -107,7 +107,7 @@
                                titleObj, prefix, ext;
 
                        titleObj = mw.Title.newFromText( title );
-                       ext = mw.Title.normalizeExtension( 
titleObj.getExtension() );
+                       ext = mw.Title.normalizeExtension( 
titleObj.getExtension() || '' );
                        // Strip namespace and file extension
                        prefix = titleObj.getNameText();
 
@@ -144,7 +144,7 @@
                                                                // It's a 
different file name entirely
                                                                continue;
                                                        }
-                                                       if ( ext !== 
mw.Title.normalizeExtension( ntitleObj.getExtension() ) ) {
+                                                       if ( ext !== 
mw.Title.normalizeExtension( ntitleObj.getExtension() || '' ) ) {
                                                                // It's a 
different extension, that's fine (e.g. to upload a SVG version of a PNG file)
                                                                continue;
                                                        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If982f0fada2f4883f0537c748da0adc72e15d7f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <[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