idn_to_ascii is only used if available
This commit is contained in:
parent
75d8de378c
commit
83b4bcfdbf
|
@ -137,6 +137,9 @@ class OC_Mail {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function buildAsciiEmail($emailAddress) {
|
public static function buildAsciiEmail($emailAddress) {
|
||||||
|
if (!function_exists('idn_to_ascii')) {
|
||||||
|
return $emailAddress;
|
||||||
|
}
|
||||||
|
|
||||||
list($name, $domain) = explode('@', $emailAddress, 2);
|
list($name, $domain) = explode('@', $emailAddress, 2);
|
||||||
$domain = idn_to_ascii($domain);
|
$domain = idn_to_ascii($domain);
|
||||||
|
|
|
@ -8,6 +8,15 @@
|
||||||
|
|
||||||
class Test_Mail extends PHPUnit_Framework_TestCase {
|
class Test_Mail extends PHPUnit_Framework_TestCase {
|
||||||
|
|
||||||
|
protected function setUp()
|
||||||
|
{
|
||||||
|
if (!function_exists('idn_to_ascii')) {
|
||||||
|
$this->markTestSkipped(
|
||||||
|
'The intl extension is not available.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider buildAsciiEmailProvider
|
* @dataProvider buildAsciiEmailProvider
|
||||||
* @param $expected
|
* @param $expected
|
||||||
|
|
Loading…
Reference in New Issue