Link //domain.tld values

This commit is contained in:
Jakub Vrana
2026-01-30 00:41:55 +01:00
parent 605ed2dcab
commit ca7c4d90e1
2 changed files with 2 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
## Adminer dev
- Pretty print JSON in edit
- Support multiline generated values in alter table
- Link //domain.tld values
- PostgreSQL: Offer foreign keys in create table
- PostgreSQL: Add missing parentheses to CHECK export
- PostgreSQL: Allow creating NOT DEFERRABLE foreign keys

View File

@@ -823,7 +823,7 @@ function is_mail(?string $email): bool {
/** Check whether the string is URL address */
function is_url(?string $string): bool {
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component //! IDN
return preg_match("~^(https?)://($domain?\\.)+$domain(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string); //! restrict path, query and fragment characters
return preg_match("~^((https?):)?//($domain?\\.)+$domain(:\\d+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string); //! restrict path, query and fragment characters
}
/** Check if field should be shortened