Skip to content

Commit

Permalink
Merge branch '1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
willdurand committed Feb 6, 2014
2 parents fddd63b + 8f8c85f commit e46ea11
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 @@ -145,6 +145,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 @@ -303,6 +303,10 @@ public static function dataProviderForParseParameters()
'application/json;q=1.0',
array(),
),
array(
'application/json;foo',
array(),
),
);
}
}
Expand Down

0 comments on commit e46ea11

Please sign in to comment.