Skip to content

Commit

Permalink
Fixed Link bug
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Sep 3, 2024
1 parent 0a73c5a commit b64b9b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- Fixed an error that occurred when eager-loading user addresses. ([#15629](https://github.com/craftcms/cms/pull/15629))
- Fixed styling issues with classic Live Preview. ([#15640](https://github.com/craftcms/cms/issues/15640))
- Fixed a bug where fields were bleeding out of the content pane on smaller viewports.
- Fixed a bug where Link fields didn’t allow URLs with TLDs longer than six characters.

## 5.3.6 - 2024-08-26

Expand Down
4 changes: 2 additions & 2 deletions src/fields/linktypes/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected function inputAttributes(): array

protected function pattern(): string
{
// Don't use the URL validator's pattern, as that doesn't require a TLD
return 'https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=]*)';
// Based on yii\validators\UrlValidator::$pattern
return '^https?:\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(?::\d{1,5})?(?:$|[?\/#])';
}
}

0 comments on commit b64b9b6

Please sign in to comment.