Fix processing length without ()

This commit is contained in:
Jakub Vrana 2013-12-19 18:35:30 -08:00
parent a41ee665e9
commit 45540fdae9

View file

@ -164,7 +164,7 @@ function process_length($length) {
global $enum_length;
return (preg_match("~^\\s*\\(?\\s*$enum_length(?:\\s*,\\s*$enum_length)*+\\s*\\)?\\s*\$~", $length) && preg_match_all("~$enum_length~", $length, $matches)
? "(" . implode(",", $matches[0]) . ")"
: preg_replace('~[^-0-9,+()[\]]~', '', preg_replace('~^[0-9]+~', '(\1)', $length))
: preg_replace('~^[0-9].*~', '(\0)', preg_replace('~[^-0-9,+()[\]]~', '', $length))
);
}