Skip to content
Snippets Groups Projects
Commit 07141ff9 authored by Marcelo Schmidt's avatar Marcelo Schmidt
Browse files

Escape regexp on checking email availability; change type of input to email

parent 4fdfcf71
No related branches found
No related tags found
No related merge requests found
RocketChat.checkEmailAvailability = (email) ->
return not Meteor.users.findOne({ "emails.address": { $regex : new RegExp("^" + s.trim(email) + "$", "i") } })
return not Meteor.users.findOne({ "emails.address": { $regex : new RegExp("^" + s.trim(s.escapeRegExp(email)) + "$", "i") } })
......@@ -29,9 +29,9 @@
<label for="email">{{_ "E-mail"}}</label>
<div>
{{#if allowEmailChange}}
<input type="text" name="email" id="email" placeholder="{{email}}" />
<input type="email" name="email" id="email" placeholder="{{email}}" />
{{else}}
<input type="text" name="email" id="email" placeholder="{{email}}" disabled="disabled" title="{{emailChangeDisabled}}" />
<input type="email" name="email" id="email" placeholder="{{email}}" disabled="disabled" title="{{emailChangeDisabled}}" />
{{/if}}
</div>
</div>
......
......@@ -15,7 +15,7 @@
</div>
<div class="input-line">
<label for="email">{{_ "E-mail"}}</label>
<input type="text" id="email" autocomplete="off" value="{{email}}">
<input type="email" id="email" autocomplete="off" value="{{email}}">
</div>
{{#if hasPermission 'edit-other-user-password'}}
<div class="input-line">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment