-
Notifications
You must be signed in to change notification settings - Fork 136
fixed a bug where empty $email was passed to idn_to_utf8 #94
Conversation
checked if $email is not empty before passing it to idn_to_utf8
Test case already exist for empty value |
@@ -547,6 +547,9 @@ protected function idnToAscii($email) | |||
*/ | |||
protected function idnToUtf8($email) | |||
{ | |||
if(strlen($email) == 0) | |||
return $email; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PSR-2, missing parentheses and space after if
@@ -547,6 +547,9 @@ protected function idnToAscii($email) | |||
*/ | |||
protected function idnToUtf8($email) | |||
{ | |||
if (strlen($email) == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PSR-2 missing opening and closing parentheses: http://www.php-fig.org/psr/psr-2/#5-1-if-elseif-else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@webimpress braces where missing not parentheses.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Exlord sorry, you have right :) thanks for your fix
Could you also provide test for your change? |
@webimpress Test case already exist for empty value |
|
fixed a bug where empty $email was passed to idn_to_utf8
Thanks, @Exlord |
checked if $email is not empty before passing it to idn_to_utf8.
idn_to_utf8 throws a warning when value is empty