Commit 658fcf5e authored by catch's avatar catch
Browse files

Issue #3496405 by spokje: [random test failure] EditorSecurityTest::testEditorXssFilterOverride

(cherry picked from commit 3e2ec19f)
parent 29972a4e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -66,7 +66,7 @@ public function editorJsSettingsAlter(&$settings): void {
  #[Hook('editor_xss_filter_alter')]
  public function editorXssFilterAlter(&$editor_xss_filter_class, FilterFormatInterface $format, ?FilterFormatInterface $original_format = NULL): void {
    // Allow tests to enable or disable this alter hook.
    if (!\Drupal::state()->get('editor_test_editor_xss_filter_alter_enabled', FALSE)) {
    if (!\Drupal::keyValue('editor_test')->get('editor_xss_filter_alter_enabled', FALSE)) {
      return;
    }
    $filters = $format->filters()->getAll();
+2 −2
Original line number Diff line number Diff line
@@ -445,9 +445,9 @@ public function testEditorXssFilterOverride(): void {
    $this->drupalGet('node/2/edit');
    $this->assertSession()->fieldValueEquals('edit-body-0-value', self::$sampleContentSecured);

    // Enable editor_test.module's hook_editor_xss_filter_alter() implementation
    // Enable editor_test's hook_editor_xss_filter_alter() implementation
    // to alter the text editor XSS filter class being used.
    \Drupal::state()->set('editor_test_editor_xss_filter_alter_enabled', TRUE);
    \Drupal::keyValue('editor_test')->set('editor_xss_filter_alter_enabled', TRUE);

    // First: the Insecure text editor XSS filter.
    $this->drupalGet('node/2/edit');