01tonythomas has uploaded a new change for review.
https://gerrit.wikimedia.org/r/169326
Change subject: Trim trailing dots in UploadWizard filename
......................................................................
Trim trailing dots in UploadWizard filename
The trailing whitespace is already removed by the trim command in the
js file. This patch will remove trailing dots, if any.
Bug: 71704
Change-Id: I3e528465b2fa6b8f00c7f1a55ef00f6b0cbc5cb9
---
M resources/mw.UploadWizardDetails.js
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/26/169326/1
diff --git a/resources/mw.UploadWizardDetails.js
b/resources/mw.UploadWizardDetails.js
index aebecf4..61bcf94 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -1703,7 +1703,9 @@
var ext = this.upload.title.getExtension(),
re = new RegExp( '\\.' +
this.upload.title.getExtension() + '$', 'i' ),
cleaned = $.trim( s.replace( re, '' ) );
-
+ if ( cleaned.slice( -1 ) == '.' ) {
+ cleaned = cleaned.slice( 0, -1 );
+ }
this.upload.title =
mw.UploadWizardDetails.makeTitleInFileNS( cleaned + '.' + ext ) ||
this.upload.title;
return this.upload.title;
}
--
To view, visit https://gerrit.wikimedia.org/r/169326
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e528465b2fa6b8f00c7f1a55ef00f6b0cbc5cb9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: 01tonythomas <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits