File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
tests/Unit/Traffic/Message Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ private function parseContact(string $line): Contact
191191 {
192192 if (\preg_match ('/^\s*(?<name>.*)\s*<(?<email>.*)>\s*$/ ' , $ line , $ matches ) === 1 ) {
193193 return new Contact (
194- $ matches ['name ' ] ? \trim ($ matches ['name ' ], ' " ' ) : null ,
194+ $ matches ['name ' ] ? \trim (\trim ( $ matches ['name ' ]) , '" ' ) : null ,
195195 $ matches ['email ' ] ? \trim ($ matches ['email ' ]) : null ,
196196 );
197197 }
Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ public static function dataTo(): iterable
4343 new Smtp \Contact ('Mary Smith: Personal Account ' , 'smith@home.example ' ),
4444 ],
4545 ];
46+
47+ yield [
48+ ['" Mary Smith: Personal Account " <smith@home.example> ' ],
49+ [
50+ new Smtp \Contact (' Mary Smith: Personal Account ' , 'smith@home.example ' ),
51+ ],
52+ ];
4653 }
4754
4855 /**
You can’t perform that action at this time.
0 commit comments