Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[User Accounts] Email encoding issue (Redmine10193) #2018

Merged
merged 2 commits into from
Jul 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/user_accounts/php/NDB_Form_user_accounts.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,9 @@ class NDB_Form_User_Accounts extends NDB_Form
*/
private function _getEmailError($DB, $email)
{
// remove illegal characters
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FILTER_SANITIZE_EMAIL removes illegal characters but does not fix encoding issues as described in the redmine ticket

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The email stays the same and it solves this issue. Are there any reasons why this shouldn't be used?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@driusan I hate to say I was right but... I was right.

This addition breaks email addresses that contain HTML special chars such as [email protected]>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like at some point there might have been a bad merge, because here there is no if statement but in #8137 there is (resulting in filter_var being called twice)


// check email address' uniqueness
$query = "SELECT COUNT(*) FROM users WHERE Email = :VEmail ";
$params = array('VEmail' => $email);
Expand Down