fix: Don't urlencode all resource URLs (#3988)

While this does suppress errors, it breaks even valid URLs. Instead, just
suppress the validation error for those few cases in the database.
This commit is contained in:
Lars Eggert 2022-05-19 10:31:29 -07:00 committed by GitHub
parent 820b70a4f1
commit 8ef92312d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

View file

@ -107,7 +107,7 @@
{% if resources %}
{% for resource in resources|dictsort:"display_name" %}
{% if resource.name.type.slug == 'url' or resource.name.type.slug == 'email' %}
<a href="{{ resource.value|urlencode }}" title="{{ resource.name.name }}">
<a href="{{ resource.value }}" title="{{ resource.name.name }}">
{% firstof resource.display_name resource.name.name %}
</a>
<br>

View file

@ -366,7 +366,7 @@
{% if resources or doc.group and doc.group.list_archive %}
{% for resource in resources|dictsort:"display_name" %}
{% if resource.name.type.slug == 'url' or resource.name.type.slug == 'email' %}
<a href="{{ resource.value|urlencode }}" title="{{ resource.name.name }}">
<a href="{{ resource.value }}" title="{{ resource.name.name }}">
{% firstof resource.display_name resource.name.name %}
</a>
<br>

View file

@ -150,7 +150,7 @@
{% for resource in resources|dictsort:"display_name" %}
{# Maybe make how a resource displays itself a method on the class so templates aren't doing this switching #}
{% if resource.name.type.slug == 'url' or resource.name.type.slug == 'email' %}
<a href="{{ resource.value|urlencode }}" title="{{ resource.name.name }}">
<a href="{{ resource.value }}" title="{{ resource.name.name }}">
{% firstof resource.display_name resource.name.name %}</a>{% else %}
<span title="{{ resource.name.name }}">
{% firstof resource.display_name resource.name.name %}: {{ resource.value|escape }}

View file

@ -177,6 +177,7 @@ def vnu_filter_message(msg, filter_db_issues, filter_test_issues):
"True if the vnu message is a known false positive"
if filter_db_issues and re.search(
r"""^Forbidden\ code\ point\ U\+|
Illegal\ character\ in\ query:\ '\['|
'href'\ on\ element\ 'a':\ Percentage\ \("%"\)\ is\ not\ followed|
^Saw\ U\+\d+\ in\ stream|
^Document\ uses\ the\ Unicode\ Private\ Use\ Area""",