Skip to content

Commit

Permalink
Update EmailAddress.php
Browse files Browse the repository at this point in the history
  [Exception]
  Deprecated Functionality: explode(): Passing null to parameter magento#2 ($string)
   of type string is deprecated in /var/www/html/lib/internal/Magento/Framewo
  rk/Validator/EmailAddress.php on line 68
  • Loading branch information
in-session authored Aug 13, 2024
1 parent fa21fcf commit dd12118
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/internal/Magento/Framework/Validator/EmailAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ public function setValidateTld(bool $shouldValidate)
*/
public function isValid($value)
{
$bannedHostsConfig = $this->scopeConfig->getValue('customer/email_validation/banned_hosts');
$bannedHosts = array_map('trim', explode("\n", $bannedHostsConfig));
$bannedHostsConfig = $this->scopeConfig->getValue('customer/email_validation/banned_hosts', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

$bannedHosts = array_map('trim', explode("\n", (string) $bannedHostsConfig));

$hostname = explode('@', $value)[1] ?? '';
if (in_array($hostname, $bannedHosts, true)) {
Expand Down

0 comments on commit dd12118

Please sign in to comment.