Commit 3ad81ec0 authored by catch's avatar catch

Issue #1992834 by alexpott: Fixed Unnecessarily setting up the array of...

Issue #1992834 by alexpott: Fixed Unnecessarily setting up the array of priority formats for content negotiation within a loop.
parent ef326513
......@@ -38,9 +38,9 @@ public function getContentType(Request $request) {
// Check all formats, if priority format is found return it.
$first_found_format = FALSE;
$priority = array('html', 'drupal_ajax', 'drupal_modal', 'drupal_dialog');
foreach ($request->getAcceptableContentTypes() as $mime_type) {
$format = $request->getFormat($mime_type);
$priority = array('html', 'drupal_ajax', 'drupal_modal', 'drupal_dialog');
if (in_array($format, $priority, TRUE)) {
return $format;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment