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

Commit b07229a

Browse files
authored
Merge pull request #1 from coresh/coresh-patch-fix-undefined-offset
Fix exception notice "Undefined offset: 1"
2 parents 81397ef + 3d5aa84 commit b07229a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Header/ContentSecurityPolicy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static function fromString($headerLine)
112112
foreach ($tokens as $token) {
113113
$token = trim($token);
114114
if ($token) {
115-
list($directiveName, $directiveValue) = explode(' ', $token, 2);
115+
list($directiveName, $directiveValue) = array_pad(explode(' ', $token, 2), 2, null);
116116
if (! isset($header->directives[$directiveName])) {
117117
$header->setDirective($directiveName, [$directiveValue]);
118118
}

0 commit comments

Comments
 (0)