Fix processing length without ()
This commit is contained in:
parent
a41ee665e9
commit
45540fdae9
|
@ -164,7 +164,7 @@ function process_length($length) {
|
||||||
global $enum_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)
|
return (preg_match("~^\\s*\\(?\\s*$enum_length(?:\\s*,\\s*$enum_length)*+\\s*\\)?\\s*\$~", $length) && preg_match_all("~$enum_length~", $length, $matches)
|
||||||
? "(" . implode(",", $matches[0]) . ")"
|
? "(" . implode(",", $matches[0]) . ")"
|
||||||
: preg_replace('~[^-0-9,+()[\]]~', '', preg_replace('~^[0-9]+~', '(\1)', $length))
|
: preg_replace('~^[0-9].*~', '(\0)', preg_replace('~[^-0-9,+()[\]]~', '', $length))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue