Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/292336
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/36/292336/1
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: newchange
Gerrit-Change-Id: If982f0fada2f4883f0537c748da0adc72e15d7f4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits