-
Notifications
You must be signed in to change notification settings - Fork 111
unable to parse To headers with semicolon separator #147
unable to parse To headers with semicolon separator #147
Conversation
parser gives "The input exceeds the allowed length" error if headers are separated by semicolon zendframework/zend-mail#147 \Zend\Mail\Header\Exception\InvalidArgumentException extends \Zend\Mail\Exception\InvalidArgumentException so both exceptions covered
Your unit test is malformed. Instead of a failing assertion, an exception is being raised due to a line that is longer than allowed. Additionally, I'm not quite sure how to address this. The Please try and fix the unit test so that we know we're failing due to the |
the test case is written with "fixed" code in mind. it will pass if code behaves as expected. in other words, the code paths used should not throw, but it throws because it encounters different error (field too long) i don't see how you want this to be fixed or why. assertions are also exceptions internally. looks pointless eeb0031 the wrap is not needed once the code is fixed. |
@weierophinney requested changes are made altho i slightly disagree with them! |
eeb0031
to
8ededca
Compare
This patch adds a new class, `AddressListParser`, with a single static method `parse()`. It loops through each character of the value to identify non-escaped, non-quoted delimiters, allowing either `,` or `;` to be used. `AbstractAddressList::fromString()` now uses the above method instead of `str_getcsv()` to extract the list of addresses. The patch also updates the test provided in zendframework#147 to test for the existence of all addresses in the test string.
Also removes stub for 3.0.0; master branch is targeted at 2.9.x-dev.
c923715
to
1345849
Compare
This patch adds a new class, `AddressListParser`, with a single static method `parse()`. It loops through each character of the value to identify non-escaped, non-quoted delimiters, allowing either `,` or `;` to be used. `AbstractAddressList::fromString()` now uses the above method instead of `str_getcsv()` to extract the list of addresses. The patch also updates the test provided in zendframework#147 to test for the existence of all addresses in the test string.
Also removes stub for 3.0.0; master branch is targeted at 2.9.x-dev.
This patch adds a new class, `AddressListParser`, with a single static method `parse()`. It loops through each character of the value to identify non-escaped, non-quoted delimiters, allowing either `,` or `;` to be used. `AbstractAddressList::fromString()` now uses the above method instead of `str_getcsv()` to extract the list of addresses. The patch also updates the test provided in zendframework#147 to test for the existence of all addresses in the test string.
Also removes stub for 3.0.0; master branch is targeted at 2.9.x-dev.
1345849
to
83f9dde
Compare
Thanks, @glensc, for the test; got a good fix in place now. |
i wonder why Zend\Mail does not split on semicolon?
To: user1@domain.com; user2@domain.org
. to my knowledge outlook sends out such mails: linkTo: undisclosed recipients:;
. another examplethis PR adds testcase that should not fail