This commit is contained in:
Hannes Rüger 2026-02-25 14:01:23 +01:00 committed by GitHub
commit e54fa7f076
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View file

@ -250,7 +250,7 @@ class InfoProviderController extends AbstractController
//Redirect to the part creation page with the found part detail //Redirect to the part creation page with the found part detail
return $this->redirectToRoute('info_providers_create_part', [ return $this->redirectToRoute('info_providers_create_part', [
'providerKey' => $searchResult->provider_key, 'providerKey' => $searchResult->provider_key,
'providerId' => $searchResult->provider_id, 'providerId' => urlencode($searchResult->provider_id),
]); ]);
} }
} catch (ExceptionInterface $e) { } catch (ExceptionInterface $e) {

View file

@ -311,6 +311,7 @@ class GenericWebProvider implements InfoProviderInterface
private function fixAndValidateURL(string $url): string private function fixAndValidateURL(string $url): string
{ {
$originalUrl = $url; $originalUrl = $url;
$url = urldecode($url);
//Add scheme if missing //Add scheme if missing
if (!preg_match('/^https?:\/\//', $url)) { if (!preg_match('/^https?:\/\//', $url)) {

View file

@ -116,10 +116,10 @@
{% if update_target %} {# We update an existing part #} {% if update_target %} {# We update an existing part #}
{% set href = path('info_providers_update_part', {% set href = path('info_providers_update_part',
{'providerKey': dto.provider_key, 'providerId': dto.provider_id, 'id': update_target.iD}) %} {'providerKey': dto.provider_key, 'providerId': dto.provider_id|url_encode, 'id': update_target.iD}) %}
{% else %} {# Create a fresh part #} {% else %} {# Create a fresh part #}
{% set href = path('info_providers_create_part', {% set href = path('info_providers_create_part',
{'providerKey': dto.provider_key, 'providerId': dto.provider_id}) %} {'providerKey': dto.provider_key, 'providerId': dto.provider_id|url_encode}) %}
{% endif %} {% endif %}
{# If we have no local part, then we can just show the create button #} {# If we have no local part, then we can just show the create button #}
@ -139,7 +139,7 @@
target="_blank" title="{% trans %}info_providers.search.show_existing_part{% endtrans %}"> target="_blank" title="{% trans %}info_providers.search.show_existing_part{% endtrans %}">
<i class="fa-solid fa-search"></i> <i class="fa-solid fa-search"></i>
</a> </a>
<a class="btn btn-primary" href="{{ path("info_providers_update_part", {'id': localPart.id, 'providerKey': dto.provider_key, 'providerId': dto.provider_id}) }}" <a class="btn btn-primary" href="{{ path("info_providers_update_part", {'id': localPart.id, 'providerKey': dto.provider_key, 'providerId': dto.provider_id|url_encode}) }}"
target="_blank" title="{% trans %}info_providers.search.update_existing_part{% endtrans %}"> target="_blank" title="{% trans %}info_providers.search.update_existing_part{% endtrans %}">
<i class="fa-solid fa-arrows-rotate"></i> <i class="fa-solid fa-arrows-rotate"></i>
</a> </a>