mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-03 13:59:35 +00:00
fix(generic info provider): urlencode url
This commit is contained in:
parent
41252d8bb9
commit
79513f368b
2 changed files with 4 additions and 3 deletions
|
|
@ -310,6 +310,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)) {
|
||||||
|
|
|
||||||
|
|
@ -110,10 +110,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 #}
|
||||||
|
|
@ -133,7 +133,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>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue