mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Fix trim accept header parts
This commit is contained in:
parent
c8d8adfefe
commit
249c7048d9
@ -809,7 +809,7 @@ class HTTPRequest implements ArrayAccess
|
||||
public function getAcceptMimetypes($includeQuality = false)
|
||||
{
|
||||
$mimetypes = array();
|
||||
$mimetypesWithQuality = explode(',', $this->getHeader('Accept'));
|
||||
$mimetypesWithQuality = preg_split('#\s*,\s*#', $this->getHeader('Accept'));
|
||||
foreach ($mimetypesWithQuality as $mimetypeWithQuality) {
|
||||
$mimetypes[] = ($includeQuality) ? $mimetypeWithQuality : preg_replace('/;.*/', '', $mimetypeWithQuality);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user