Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #535 from communitiesuk/FS-4357-making-protocol-ca…
Browse files Browse the repository at this point in the history
…se-insensitive

FS-4357: Protocol validation made case insensitive
  • Loading branch information
hamzabinkhalid authored May 15, 2024
2 parents 45c4bf1 + 00bc1ff commit d992c8f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class WebsiteField extends TextField {
this.formSchema = this.formSchema
.label(def.title)
.pattern(
/^(https?:\/\/)?(www\.)?[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/
/^((https?|HTTPS?):\/\/)?(www\.)?[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/
)
.message(def.options?.customValidationMessage ?? this.defaultMessage);

Expand Down
2 changes: 1 addition & 1 deletion runner/src/server/views/partials/summary-row.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% for itemValue in item.value%}
{{itemValue}}<br>
{% endfor %}
{% elif item.type == 'NumberField' or item.type == 'WebsiteField' and not ( 'https://' in item.value or 'http://' in item.value ) %}
{% elif item.type == 'NumberField' or item.type == 'WebsiteField' and 'http' not in item.value|lower %}
{{item.prefix}}{{item.value}}
{% elif item.type == 'ClientSideFileUploadField' %}
{% if item.value.files|length == 0 %}
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=0.1.271
VERSION=0.1.272

0 comments on commit d992c8f

Please sign in to comment.