mirror of
https://github.com/discourse/discourse.git
synced 2025-02-21 03:11:56 +08:00
FIX: escape input of forgot password form before rendering it back to you
This commit is contained in:
parent
7dade2cd99
commit
82bdef2047
@ -24,10 +24,11 @@ export default Discourse.Controller.extend(Discourse.ModalFunctionality, {
|
||||
});
|
||||
|
||||
// don't tell people what happened, this keeps it more secure (ensure same on server)
|
||||
var escaped = Handlebars.Utils.escapeExpression(this.get('accountEmailOrUsername'));
|
||||
if (this.get('accountEmailOrUsername').match(/@/)) {
|
||||
this.flash(I18n.t('forgot_password.complete_email', {email: this.get('accountEmailOrUsername')}));
|
||||
this.flash(I18n.t('forgot_password.complete_email', {email: escaped}));
|
||||
} else {
|
||||
this.flash(I18n.t('forgot_password.complete_username', {username: this.get('accountEmailOrUsername')}));
|
||||
this.flash(I18n.t('forgot_password.complete_username', {username: escaped}));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user