From 11d642dcc3a0ac496ceda574236bdbe5f265555d Mon Sep 17 00:00:00 2001 From: alufers Date: Sat, 4 Apr 2026 15:47:19 +0200 Subject: [PATCH] Fix creating TME parts with percent signs in SPN The SPN ends up in the URL, which later causes validation errors n the form. Solved by encoding the percent sign. --- src/Services/InfoProviderSystem/Providers/TMEProvider.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Services/InfoProviderSystem/Providers/TMEProvider.php b/src/Services/InfoProviderSystem/Providers/TMEProvider.php index 938bc7b3..93222517 100644 --- a/src/Services/InfoProviderSystem/Providers/TMEProvider.php +++ b/src/Services/InfoProviderSystem/Providers/TMEProvider.php @@ -280,9 +280,13 @@ class TMEProvider implements InfoProviderInterface, URLHandlerInfoProviderInterf { //If a URL starts with // we assume that it is a relative URL and we add the protocol if (str_starts_with($url, '//')) { - return 'https:' . $url; + $url = 'https:' . $url; } + //Encode bare % signs that are not already part of a valid percent-encoded sequence + //Fixes part numbers with % in them e.g. SMD0603-5K1-1% + $url = preg_replace('/%(?![0-9A-Fa-f]{2})/', '%25', $url); + return $url; }