This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public static function fromString($headerLine)
58
58
// split value on ","
59
59
$ fieldValue = str_replace (Headers::FOLDING , ' ' , $ fieldValue );
60
60
$ fieldValue = preg_replace ('/[^:]+:([^;]*);/ ' , '$1, ' , $ fieldValue );
61
- $ values = AddressListParser ::parse ($ fieldValue );
61
+ $ values = ListParser ::parse ($ fieldValue );
62
62
63
63
$ wasEncoded = false ;
64
64
$ addresses = array_map (
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public static function fromString($headerLine)
46
46
$ header ->setType ($ parts [0 ]);
47
47
48
48
if (isset ($ parts [1 ])) {
49
- $ values = AddressListParser ::parse (trim ($ parts [1 ]), ['; ' , '= ' ]);
49
+ $ values = ListParser ::parse (trim ($ parts [1 ]), ['; ' , '= ' ]);
50
50
$ length = count ($ values );
51
51
52
52
for ($ i = 0 ; $ i < $ length ; $ i += 2 ) {
Original file line number Diff line number Diff line change 9
9
10
10
use function in_array ;
11
11
12
- class AddressListParser
12
+ class ListParser
13
13
{
14
14
const CHAR_QUOTES = ['\'' , '" ' ];
15
15
const CHAR_DELIMS = [', ' , '; ' ];
16
16
const CHAR_ESCAPE = '\\' ;
17
17
18
18
/**
19
19
* @param string $value
20
- * @param array $delims
20
+ * @param array $delims Delimiters allowed between values; parser will
21
+ * split on these, as long as they are not within quotes. Defaults
22
+ * to ListParser::CHAR_DELIMS.
21
23
* @return array
22
24
*/
23
25
public static function parse ($ value , array $ delims = self ::CHAR_DELIMS )
You can’t perform that action at this time.
0 commit comments