Unverified Commit b0f6be1f authored by Geoff Appleby's avatar Geoff Appleby
Browse files

Issue #3314249 by gapple, Valdispert: Update argument order when calling...

Issue #3314249 by gapple, Valdispert: Update argument order when calling EventDispatcher::dispatch()
parent 3894768d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,6 +13,6 @@
  "require": {
    "php": ">=7.2",
    "ext-json": "*",
    "drupal/core": "^8.5 || ^9.0"
    "drupal/core": "^9.0"
  }
}
+1 −5
Original line number Diff line number Diff line
name: Content Security Policy
type: module
description: Provide Content-Security-Policy headers
core: 8.x
core_version_requirement: ^8 || ^9
core_version_requirement: ^9
configure: csp.settings

dependencies:
- drupal:system (>= 8.5)
+1 −1
Original line number Diff line number Diff line
name: Content Security Policy Extras
type: module
description: Optional extra features for Content Security Policy
core_version_requirement: ^8.9 || ^9
core_version_requirement: ^9

dependencies:
- csp:csp
+2 −2
Original line number Diff line number Diff line
@@ -174,8 +174,8 @@ class ResponseCspSubscriber implements EventSubscriberInterface {
      }

      $this->eventDispatcher->dispatch(
        CspEvents::POLICY_ALTER,
        new PolicyAlterEvent($policy, $response)
        new PolicyAlterEvent($policy, $response),
        CspEvents::POLICY_ALTER
      );

      if (($headerValue = $policy->getHeaderValue())) {
+3 −3
Original line number Diff line number Diff line
@@ -141,13 +141,13 @@ class ResponseCspSubscriberTest extends UnitTestCase {
    $this->eventDispatcher->expects($this->exactly(2))
      ->method('dispatch')
      ->with(
        $this->equalTo(CspEvents::POLICY_ALTER),
        $this->callback(function ($event) {
          $policy = $event->getPolicy();
          return $policy->hasDirective(($policy->isReportOnly() ? 'style-src' : 'script-src'));
        })
        }),
        $this->equalTo(CspEvents::POLICY_ALTER)
      )
      ->willReturnCallback(function ($eventName, $event) {
      ->willReturnCallback(function ($event, $eventName) {
        $policy = $event->getPolicy();
        $policy->setDirective('font-src', [Csp::POLICY_SELF]);
      });