You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Direction
We use github issues to track bugs, not for support.
If you have a support question, or a feature request, raise these as threads on our forum.
Describe the bug
CodeIgniter\Email\Email class validateEmail() method line 919:
When validation is enabled and an invalid e-mail address is passed to Email class, validateEmail() tries to call lang() helper with string (the e-mail address being validated) as second parameter:
Affected module(s)
CodeIgniter\Email\Email class
and/or
system/Common.php
Expected behavior, and steps to reproduce if appropriate
To reproduce, create a simple test case:
class EmailTest extends CIUnitTestCase
{
public function testEmailValidation()
{
$config = config('Email');
$config->validate = true;
$email = new \CodeIgniter\Email\Email($config);
$email->setTo('invalid');
$this->assertStringContainsString('Invalid email address: invalid', $email->printDebugger());
}
}
Expected:
Test passes
Actual:
Tests\EmailTest::testEmailValidation
TypeError: Argument 2 passed to lang() must be of the type array, string given, called in system/Email/Email.php on line 919
Context
OS: [Linux]
Web server [Apache + PHP-FPM 7.2]
PHP version [7.2]
The text was updated successfully, but these errors were encountered:
bivanbi
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Feb 20, 2020
Direction
We use github issues to track bugs, not for support.
If you have a support question, or a feature request, raise these as threads on our
forum.
Describe the bug
CodeIgniter\Email\Email class validateEmail() method line 919:
When validation is enabled and an invalid e-mail address is passed to Email class, validateEmail() tries to call lang() helper with string (the e-mail address being validated) as second parameter:
system/Common.php lang() method signature only accepts array as second parameter:
This eventually leads to TypeError.
CodeIgniter 4 version
4.0.0rc3
develop @ dfd3555
Affected module(s)
CodeIgniter\Email\Email class
and/or
system/Common.php
Expected behavior, and steps to reproduce if appropriate
To reproduce, create a simple test case:
Expected:
Test passes
Actual:
TypeError: Argument 2 passed to lang() must be of the type array, string given, called in system/Email/Email.php on line 919
Context
The text was updated successfully, but these errors were encountered: