This repository was archived by the owner on Jan 30, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,12 @@ protected function getParametersFromFieldValuePart($fieldValuePart)
170
170
foreach ($ paramsStrings as $ param ) {
171
171
$ explode = explode ('= ' , $ param , 2 );
172
172
173
- $ value = trim ($ explode [1 ]);
173
+ if (count ($ explode ) === 2 ) {
174
+ $ value = trim ($ explode [1 ]);
175
+ } else {
176
+ $ value = trim ($ param );
177
+ }
178
+
174
179
if (isset ($ value [0 ]) && $ value [0 ] == '" ' && substr ($ value , -1 ) == '" ' ) {
175
180
$ value = substr (substr ($ value , 1 ), 0 , -1 );
176
181
}
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ public function testAcceptCharsetGetFieldValueReturnsProperValue()
32
32
$ this ->assertEquals ('xxx ' , $ acceptCharsetHeader ->getFieldValue ());
33
33
}
34
34
35
+ public function testAcceptCharsetGetFieldValueReturnsProperValueWithSemicolonWithoutEqualSign ()
36
+ {
37
+ $ acceptCharsetHeader = AcceptCharset::fromString ('Accept-Charset: xxx;yyy ' );
38
+ $ this ->assertEquals ('xxx;yyy ' , $ acceptCharsetHeader ->getFieldValue ());
39
+ }
40
+
35
41
public function testAcceptCharsetToStringReturnsHeaderFormattedString ()
36
42
{
37
43
$ acceptCharsetHeader = new AcceptCharset ();
You can’t perform that action at this time.
0 commit comments