Skip to content
Snippets Groups Projects
Commit 83b4bcfd authored by Thomas Müller's avatar Thomas Müller
Browse files

idn_to_ascii is only used if available

parent 75d8de37
No related branches found
No related tags found
No related merge requests found
......@@ -137,6 +137,9 @@ class OC_Mail {
* @return string
*/
public static function buildAsciiEmail($emailAddress) {
if (!function_exists('idn_to_ascii')) {
return $emailAddress;
}
list($name, $domain) = explode('@', $emailAddress, 2);
$domain = idn_to_ascii($domain);
......
......@@ -8,6 +8,15 @@
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
* @param $expected
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment