r85973 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85972‎ | r85973 | r85974 >
Date:18:35, 13 April 2011
Author:kaldari
Status:ok (Comments)
Tags:
Comment:
setting title maxlength to 255-5 to prevent upload failure
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js
@@ -45,7 +45,7 @@
4646 // http://commons.wikimedia.org/wiki/MediaWiki:Filename-prefix-blacklist
4747 // XXX make sure they can't use ctrl characters or returns or any other bad stuff.
4848 _this.titleId = "title" + _this.upload.index;
49 - _this.titleInput = $j( '<input type="text" id="' + _this.titleId + '" name="' + _this.titleId + '" class="mwe-title"/>' )
 49+ _this.titleInput = $j( '<input type="text" id="' + _this.titleId + '" name="' + _this.titleId + '" class="mwe-title" maxlength="250"/>' )
5050 .keyup( function() {
5151 _this.upload.title.setNameText( _this.titleInput.value );
5252 // TODO update a display of filename

Comments

#Comment by Kaldari (talk | contribs)   18:44, 13 April 2011

The -5 is for the file extension, e.g. ".jpeg"

#Comment by Bryan (talk | contribs)   21:45, 13 April 2011

Note that the maximum length is 255 bytes, while maxlength sets the maximum amount of characters, as far as I know. So you should still take care that you catch maximum length violations.

#Comment by Kaldari (talk | contribs)   22:54, 13 April 2011

True. This is just a quick fix for latin scripts. Will work on a more comprehensive checking mechanism soon.

Status & tagging log