mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 08:34:39 +00:00
Add support IDN in aliases. (#3107)
This commit is contained in:
parent
5a1b1d50f0
commit
f3dad94b38
@ -214,7 +214,7 @@ class Util
|
||||
*/
|
||||
public static function isDomain($domain)
|
||||
{
|
||||
$pattern = '/^(?:(?:[a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])\.)*(?:[a-z0-9]|[a-z0-9][a-z0-9\-]*[a-z0-9])$/i';
|
||||
$pattern = '/^(?:(?:[a-z\pL0-9]|[a-z\pL0-9][a-z\pL0-9\-]*[a-z\pL0-9])\.)*(?:[a-z\pL0-9]|[a-z\pL0-9][a-z\pL0-9\-]*[a-z\pL0-9])$/iu';
|
||||
if (preg_match($pattern, $domain)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -16,11 +16,11 @@
|
||||
{% if alias.enabled|default('0') == '0'%}
|
||||
<address></address>
|
||||
{% elif alias.type.startswith('urltable') %}
|
||||
<url>{{ alias.content|e }}</url>
|
||||
<url>{{ alias.content|e|encode_idna }}</url>
|
||||
{% elif alias.type.startswith('url') %}
|
||||
<aliasurl>{{ alias.content|e }}</aliasurl>
|
||||
<aliasurl>{{ alias.content|e|encode_idna }}</aliasurl>
|
||||
{% elif alias.content %}
|
||||
<address>{{ alias.content|e }}</address>
|
||||
<address>{{ alias.content|e|encode_idna }}</address>
|
||||
{% endif %}{% if alias.proto %}
|
||||
<proto>{{ alias.proto|e }}</proto>
|
||||
{% endif %}{% if alias.updatefreq %}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user