This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -144,4 +144,24 @@ public function testSemicolonSeparator()
144144 $ this ->assertTrue ($ addressList ->has ('asda.fasd@example.net ' ));
145145 $ this ->assertTrue ($ addressList ->has ('root@example.org ' ));
146146 }
147+
148+ /**
149+ * If name-field is quoted with "", then ' inside it should not treated eqally.
150+ */
151+ public function testMixedQuotesInName () {
152+ $ header = '"Bob O \'Reilly" <bob@example.com>,blah@example.com ' ;
153+
154+ // In previous versions, this throws: 'The input exceeds the allowed
155+ // length'; hence the try/catch block, to allow finding the root cause.
156+ try {
157+ $ to = Header \To::fromString ('To: ' . $ header );
158+ } catch (InvalidArgumentException $ e ) {
159+ $ this ->fail ('Header\To::fromString should not throw ' );
160+ }
161+
162+ $ addressList = $ to ->getAddressList ();
163+ $ this ->assertTrue ($ addressList ->has ('bob@example.com ' ));
164+ $ this ->assertTrue ($ addressList ->has ('blah@example.com ' ));
165+ $ this ->assertEquals ("Bob O'Reilly " , $ addressList ->get ('bob@example.com ' )->getName ());
166+ }
147167}
You can’t perform that action at this time.
0 commit comments