Commit ccce36ec authored by catch's avatar catch
Browse files

fix: #3557270 \Drupal\filter\Element\TextFormat::processFormat() triggers deprecations on PHP 8.5

By: @alexpott
(cherry picked from commit 4276068a)
parent cd0b9b30
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -213,9 +213,9 @@ public static function processFormat(&$element, FormStateInterface $form_state,
    ];

    $all_formats = filter_formats();
    $format_exists = isset($all_formats[$element['#format']]);
    $format_exists = isset($element['#format'], $all_formats[$element['#format']]);
    $format_allowed = !isset($element['#allowed_formats']) || in_array($element['#format'], $element['#allowed_formats']);
    $user_has_access = isset($formats[$element['#format']]);
    $user_has_access = isset($element['#format'], $formats[$element['#format']]);
    $user_is_admin = $user->hasPermission('administer filters');

    // If the stored format does not exist or if it is not among the allowed