@@ -31,7 +31,7 @@ private function __construct()
31
31
* Example:
32
32
*
33
33
* HeaderUtils::split("da, en-gb;q=0.8", ",;")
34
- * // => array(array("da" ), array(" en-gb"), array("q", " 0.8" ))
34
+ * // => array(array('da' ), array(' en-gb', 'q= 0.8' ))
35
35
*
36
36
* @param string $header HTTP header value
37
37
* @param string $separators List of characters to split on, ordered by
@@ -42,7 +42,7 @@ private function __construct()
42
42
*/
43
43
public static function split (string $ header , string $ separators ): array
44
44
{
45
- $ quotedSeparators = preg_quote ($ separators );
45
+ $ quotedSeparators = preg_quote ($ separators, ' / ' );
46
46
47
47
preg_match_all ('
48
48
/
@@ -71,7 +71,7 @@ public static function split(string $header, string $separators): array
71
71
* Each of the nested arrays should have one or two elements. The first
72
72
* value will be used as the keys in the associative array, and the second
73
73
* will be used as the values, or true if the nested array only contains one
74
- * element.
74
+ * element. Array keys are lowercased.
75
75
*
76
76
* Example:
77
77
*
@@ -94,13 +94,13 @@ public static function combineParts(array $parts): array
94
94
* Joins an associative array into a string for use in an HTTP header.
95
95
*
96
96
* The key and value of each entry are joined with "=", and all entries
97
- * is joined with the specified separator and an additional space (for
97
+ * are joined with the specified separator and an additional space (for
98
98
* readability). Values are quoted if necessary.
99
99
*
100
100
* Example:
101
101
*
102
102
* HeaderUtils::joinAssoc(array("foo" => "abc", "bar" => true, "baz" => "a b c"), ",")
103
- * // => 'foo=bar, baz , baz="a b c"'
103
+ * // => 'foo=abc, bar , baz="a b c"'
104
104
*/
105
105
public static function joinAssoc (array $ assoc , string $ separator ): string
106
106
{
0 commit comments