Allow to parse ranges for ParameterDTO which just contain two dots

This commit is contained in:
Jan Böhmer 2025-02-20 00:17:53 +01:00
parent 5612a790fb
commit 376c7e7a6f
2 changed files with 13 additions and 3 deletions

View file

@ -72,9 +72,9 @@ class ParameterDTO
group: $group);
}
//If the attribute contains "..." or a tilde we assume it is a range
if (preg_match('/(\.{3}|~)/', $value) === 1) {
$parts = preg_split('/\s*(\.{3}|~)\s*/', $value);
//If the attribute contains ".." or "..." or a tilde we assume it is a range
if (preg_match('/(\.{2,3}|~)/', $value) === 1) {
$parts = preg_split('/\s*(\.{2,3}|~)\s*/', $value);
if (count($parts) === 2) {
//Try to extract number and unit from value (allow leading +)
if ($unit === null || trim($unit) === '') {