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.
This commit is contained in:
alufers 2026-04-04 15:47:19 +02:00
parent 96da2b9f1f
commit 11d642dcc3

View file

@ -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;
}