Skip to content

Commit

Permalink
Merge branch '1.0' into 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Feb 11, 2014
2 parents 8b32a05 + 8f8c85f commit 84c855a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Negotiation/Negotiator.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ protected function parseParameters($value)
foreach ($parts as $part) {
$part = explode('=', $part);

if (2 !== count($part)) {
continue;
}

if ('q' !== $key = strtolower($part[0])) {
$parameters[$key] = $part[1];
}
Expand Down
4 changes: 4 additions & 0 deletions tests/Negotiation/Tests/NegotiatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ public static function dataProviderForParseParameters()
'application/json;q=1.0',
array(),
),
array(
'application/json;foo',
array(),
),
);
}
}
Expand Down

0 comments on commit 84c855a

Please sign in to comment.