|  | 
  Josep Sanz Campderrós - 2024-11-04 10:00:49Fixed a bug in php8.1 in rfc822_addresses.php to solve the problem when local_part is null
 Function ParseAddrSpec(&$p, &$addr_spec)
 {
 $addr_spec = null;
 $v = $this->v;
 $l = strlen($v);
 $a = $p;
 if(!$this->ParseQuotedString($a, $local_part))
 return(0);
 if(!IsSet($local_part))
 {
 if(!$this->ParseAtom($a, $local_part, 1))
 return(0);
 // BEGIN TO SOLVE THE PROBLEM WHEN LOCAL_PART IS NULL IN PHP8.1 BY SANZ
 if(!IsSet($local_part))
 return(1);
 // END TO SOLVE THE PROBLEM WHEN LOCAL_PART IS NULL IN PHP8.1 BY SANZ
 $local_part = trim($local_part);
 }
 if($a >= $l
 || strcmp($v[$a], '@'))
 return(1);
 ++$a;
 if(!$this->ParseAtom($a, $domain, 1))
 return(0);
 if(!IsSet($domain))
 return(1);
 $addr_spec = $local_part.'@'.trim($domain);
 $p = $a;
 return(1);
 }
 
  Manuel Lemos - 2024-11-04 12:22:04 - In reply to message 1 from Josep Sanz CampderrósHello Josep,
 Great. Can you provide an example address that I can use to create a test to verify the issue?
  abc def - 2025-04-07 00:19:47 - In reply to message 2 from Manuel LemosThis should throw an error with all addresses.
 In ParseAddressList() you have
 $p = 0;
 if(!$this->ParseAddress($p, $address))
 In ParseAddrSpec(), this goes to this function
 $a = $p;
 if(!$this->ParseQuotedString($a, $local_part))
 And in Function ParseQuotedString(&$p, &$quoted_string)
 $quoted_string = null;
 $s = $p;
 if($s >= $l
 || strcmp($v[$s], '"'))
 return(1);
 Which will leave $local_part as NULL.
 if(!IsSet($local_part))
 {
 $local_part = trim($local_part);
 This will do trim(null) and fail.
  Manuel Lemos - 2025-04-08 21:05:46 - In reply to message 3 from abc defGreat. Let me try to check that over the weekend.
  Manuel Lemos - 2025-04-20 21:17:09 - In reply to message 3 from abc defHello,
 I need a sample message that I can use to reproduce the issues, so I can verify if the fix works correctly.
 
 Can you provide a sample message that I can use to test this issue?
 |