mediawiki.feedback.js: Trim whitespace from message and subject
authorVivek Ghaisas <v.a.ghaisas@gmail.com>
Wed, 24 Dec 2014 11:20:47 +0000 (14:20 +0300)
committerVivek Ghaisas <v.a.ghaisas@gmail.com>
Wed, 24 Dec 2014 11:57:51 +0000 (14:57 +0300)
Remove leading and trailing whitespace from submitted feedback message
and subject.

Bug: T35192
Change-Id: Ie260e3b1b15092ea49dc7b8a1a06e0094a0178a3

resources/src/mediawiki/mediawiki.feedback.js

index 587f5b9..867134c 100644 (file)
                                fb = this;
 
                        // Get the values to submit.
-                       subject = this.subjectInput.value;
+                       subject = $.trim( this.subjectInput.value );
 
                        // We used to include "mw.html.escape( navigator.userAgent )" but there are legal issues
                        // with posting this without their explicit consent
-                       message = this.messageInput.value;
+                       message = $.trim( this.messageInput.value );
                        if ( message.indexOf( '~~~' ) === -1 ) {
                                message += ' ~~~~';
                        }