From 77b28327c8bd08cb34335c1ccb23f0860113a2b1 Mon Sep 17 00:00:00 2001 From: Frank Fenor Date: Sat, 24 Feb 2024 16:58:41 +0100 Subject: [PATCH] =?UTF-8?q?Escape=20decimal=20point=20and=20add=20slash=20?= =?UTF-8?q?to=20valid=20unit=20characters=20to=20be=20able=20to=20pick=20u?= =?UTF-8?q?p=20for=20example=20"ppm/=C2=B0C"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Services/InfoProviderSystem/DTOs/ParameterDTO.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php b/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php index e929fc2b..e8ff9fb9 100644 --- a/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php +++ b/src/Services/InfoProviderSystem/DTOs/ParameterDTO.php @@ -106,7 +106,7 @@ class ParameterDTO */ public static function splitIntoValueAndUnit(string $value): ?array { - if (preg_match('/^(?-?[0-9.]+)\s*(?[%Ω°℃a-zA-Z_]+\s?\w{0,4})$/u', $value, $matches)) { + if (preg_match('/^(?-?[0-9\.]+)\s*(?[%Ω°℃a-z_\/]+\s?\w{0,4})$/iu', $value, $matches)) { $value = $matches['value']; $unit = $matches['unit'];