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
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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.
Please register or to comment