Skip to content

Commit d820507

Browse files
author
Edwin Westerhoud
committed
Avoid notice in case the header cannot be parsed.
1 parent 3509bff commit d820507

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/class-tiny-compress.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ protected static function parse_headers($headers) {
9191
}
9292
$res = array();
9393
foreach ($headers as $header) {
94-
list($key, $value) = explode(":", $header, 2);
95-
if ($value) {
96-
$res[$key] = trim($value);
94+
$split = explode(":", $header, 2);
95+
if (count($split) === 2) {
96+
$res[$split[0]] = trim($split[1]);
9797
}
9898
}
9999
return $res;

0 commit comments

Comments
 (0)