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)
|
public function getAcceptMimetypes($includeQuality = false)
|
||||||
{
|
{
|
||||||
$mimetypes = array();
|
$mimetypes = array();
|
||||||
$mimetypesWithQuality = explode(',', $this->getHeader('Accept'));
|
$mimetypesWithQuality = preg_split('#\s*,\s*#', $this->getHeader('Accept'));
|
||||||
foreach ($mimetypesWithQuality as $mimetypeWithQuality) {
|
foreach ($mimetypesWithQuality as $mimetypeWithQuality) {
|
||||||
$mimetypes[] = ($includeQuality) ? $mimetypeWithQuality : preg_replace('/;.*/', '', $mimetypeWithQuality);
|
$mimetypes[] = ($includeQuality) ? $mimetypeWithQuality : preg_replace('/;.*/', '', $mimetypeWithQuality);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user