Skip to content

Commit 0dfcbbd

Browse files
committed
accept weird directive names
like text/vnd.sun.j2me.app-descriptor
1 parent eb2d352 commit 0dfcbbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Directive.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,14 @@ private static function processText($text)
171171
}
172172

173173
private static function checkKeyValue($text) {
174-
if (1 === preg_match('#^([a-z_]+)\s+([^;{]+)$#', $text, $matches)) {
174+
if (1 === preg_match('#^([a-z][a-z0-9._/+-]*)\s+([^;{]+)$#', $text, $matches)) {
175175
return array($matches[1], rtrim($matches[2]));
176176
}
177177
return false;
178178
}
179179

180180
private static function checkKey($text) {
181-
if (1 === preg_match('#^([a-z_]+)\s*$#', $text, $matches)) {
181+
if (1 === preg_match('#^([a-z][a-z0-9._/+-]*)\s*$#', $text, $matches)) {
182182
return array($matches[1], null);
183183
}
184184
return false;

0 commit comments

Comments
 (0)