ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //proc/self/root/opt/alt/php56/usr/share/pear/test/Mail/tests/9137_2.phpt
--TEST--
Mail: Test for bug #9137, take 2
--FILE--
<?php

require_once dirname(__FILE__) . '/../Mail/RFC822.php';
require_once 'PEAR.php';

$addresses = array(
    array('raw' => '"John Doe" <[email protected]>'),
    array('raw' => '"John Doe' . chr(92) . '" <[email protected]>'),
    array('raw' => '"John Doe' . chr(92) . chr(92) . '" <[email protected]>'),
    array('raw' => '"John Doe' . chr(92) . chr(92) . chr(92) . '" <[email protected]>'),
    array('raw' => '"John Doe' . chr(92) . chr(92) . chr(92) . chr(92) . '" <[email protected]>'),
    array('raw' => '"John Doe <[email protected]>'),
);

for ($i = 0; $i < count($addresses); $i++) {
    // construct the address
    $address = $addresses[$i]['raw'];
    $parsedAddresses = Mail_RFC822::parseAddressList($address);
    if (PEAR::isError($parsedAddresses)) {
        echo $address." :: Failed to validate\n";
    } else {
        echo $address." :: Parsed\n";
    }
}

--EXPECT--
"John Doe" <[email protected]> :: Parsed
"John Doe\" <[email protected]> :: Failed to validate
"John Doe\\" <[email protected]> :: Parsed
"John Doe\\\" <[email protected]> :: Failed to validate
"John Doe\\\\" <[email protected]> :: Parsed
"John Doe <[email protected]> :: Failed to validate