Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Jozef Sroka
ISPConfig 3
Commits
0e3cf6f5
Commit
0e3cf6f5
authored
Oct 03, 2016
by
Marius Burkard
Browse files
- use idn constants only if defined, fixes #4237
parent
7000d9bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
interface/lib/classes/functions.inc.php
View file @
0e3cf6f5
...
...
@@ -302,7 +302,11 @@ class functions {
if
(
$encode
==
true
)
{
if
(
function_exists
(
'idn_to_ascii'
))
{
$domain
=
idn_to_ascii
(
$domain
,
IDNA_NONTRANSITIONAL_TO_ASCII
,
INTL_IDNA_VARIANT_UTS46
);
if
(
defined
(
'IDNA_NONTRANSITIONAL_TO_ASCII'
)
&&
defined
(
'INTL_IDNA_VARIANT_UTS46'
)
&&
constant
(
'IDNA_NONTRANSITIONAL_TO_ASCII'
))
{
$domain
=
idn_to_ascii
(
$domain
,
IDNA_NONTRANSITIONAL_TO_ASCII
,
INTL_IDNA_VARIANT_UTS46
);
}
else
{
$domain
=
idn_to_ascii
(
$domain
);
}
}
elseif
(
file_exists
(
ISPC_CLASS_PATH
.
'/idn/idna_convert.class.php'
))
{
/* use idna class:
* @author Matthias Sommerfeld <mso@phlylabs.de>
...
...
@@ -319,7 +323,11 @@ class functions {
}
}
else
{
if
(
function_exists
(
'idn_to_utf8'
))
{
$domain
=
idn_to_utf8
(
$domain
,
IDNA_NONTRANSITIONAL_TO_ASCII
,
INTL_IDNA_VARIANT_UTS46
);
if
(
defined
(
'IDNA_NONTRANSITIONAL_TO_ASCII'
)
&&
defined
(
'INTL_IDNA_VARIANT_UTS46'
)
&&
constant
(
'IDNA_NONTRANSITIONAL_TO_ASCII'
))
{
$domain
=
idn_to_utf8
(
$domain
,
IDNA_NONTRANSITIONAL_TO_ASCII
,
INTL_IDNA_VARIANT_UTS46
);
}
else
{
$domain
=
idn_to_utf8
(
$domain
);
}
}
elseif
(
file_exists
(
ISPC_CLASS_PATH
.
'/idn/idna_convert.class.php'
))
{
/* use idna class:
* @author Matthias Sommerfeld <mso@phlylabs.de>
...
...
server/lib/classes/functions.inc.php
View file @
0e3cf6f5
...
...
@@ -354,7 +354,11 @@ class functions {
if
(
$encode
==
true
)
{
if
(
function_exists
(
'idn_to_ascii'
))
{
$domain
=
idn_to_ascii
(
$domain
,
IDNA_NONTRANSITIONAL_TO_ASCII
,
INTL_IDNA_VARIANT_UTS46
);
if
(
defined
(
'IDNA_NONTRANSITIONAL_TO_ASCII'
)
&&
defined
(
'INTL_IDNA_VARIANT_UTS46'
)
&&
constant
(
'IDNA_NONTRANSITIONAL_TO_ASCII'
))
{
$domain
=
idn_to_ascii
(
$domain
,
IDNA_NONTRANSITIONAL_TO_ASCII
,
INTL_IDNA_VARIANT_UTS46
);
}
else
{
$domain
=
idn_to_ascii
(
$domain
);
}
}
elseif
(
file_exists
(
ISPC_CLASS_PATH
.
'/idn/idna_convert.class.php'
))
{
/* use idna class:
* @author Matthias Sommerfeld <mso@phlylabs.de>
...
...
@@ -371,7 +375,11 @@ class functions {
}
}
else
{
if
(
function_exists
(
'idn_to_utf8'
))
{
$domain
=
idn_to_utf8
(
$domain
,
IDNA_NONTRANSITIONAL_TO_ASCII
,
INTL_IDNA_VARIANT_UTS46
);
if
(
defined
(
'IDNA_NONTRANSITIONAL_TO_ASCII'
)
&&
defined
(
'INTL_IDNA_VARIANT_UTS46'
)
&&
constant
(
'IDNA_NONTRANSITIONAL_TO_ASCII'
))
{
$domain
=
idn_to_utf8
(
$domain
,
IDNA_NONTRANSITIONAL_TO_ASCII
,
INTL_IDNA_VARIANT_UTS46
);
}
else
{
$domain
=
idn_to_utf8
(
$domain
);
}
}
elseif
(
file_exists
(
ISPC_CLASS_PATH
.
'/idn/idna_convert.class.php'
))
{
/* use idna class:
* @author Matthias Sommerfeld <mso@phlylabs.de>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment