Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit 89d2b79

Browse files
committed
If directiveValue is not set pass empty array instead of [mull]
1 parent 62009a6 commit 89d2b79

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Header/ContentSecurityPolicy.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ public static function fromString($headerLine)
135135
if ($token) {
136136
list($directiveName, $directiveValue) = array_pad(explode(' ', $token, 2), 2, null);
137137
if (! isset($header->directives[$directiveName])) {
138-
$header->setDirective($directiveName, [$directiveValue]);
138+
$header->setDirective(
139+
$directiveName,
140+
$directiveValue === null ? [] : [$directiveValue]
141+
);
139142
}
140143
}
141144
}

0 commit comments

Comments
 (0)