Skip to content
Snippets Groups Projects
Commit 3ad81ec0 authored by catch's avatar catch
Browse files

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
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment