IdnaConverter repository changed url

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-03-10 17:13:51 +01:00
parent b1bbb1847d
commit f7d24e8870
3 changed files with 2998 additions and 6 deletions

View File

@@ -43,10 +43,10 @@
"ext-curl": "*", "ext-curl": "*",
"ext-json": "*", "ext-json": "*",
"ext-openssl": "*", "ext-openssl": "*",
"mso/idna-convert": "1.*",
"phpmailer/phpmailer": "~6.0", "phpmailer/phpmailer": "~6.0",
"monolog/monolog": "^1.24", "monolog/monolog": "^1.24",
"robthree/twofactorauth": "^1.6" "robthree/twofactorauth": "^1.6",
"algo26-matthias/idna-convert": "^2.1"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "6.5.13", "phpunit/phpunit": "6.5.13",

2994
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -40,7 +40,7 @@ class IdnaWrapper
public function __construct() public function __construct()
{ {
// Instantiate it // Instantiate it
$this->idna_converter = new \Mso\IdnaConvert\IdnaConvert(); $this->idna_converter = new \Algo26\IdnaConvert\IdnaConvert();
} }
/** /**
@@ -59,9 +59,7 @@ class IdnaWrapper
try { try {
return $this->idna_converter->encode($to_encode); return $this->idna_converter->encode($to_encode);
} catch (\InvalidArgumentException $iae) { } catch (\InvalidArgumentException $iae) {
// dirty hack because Mso\IdnaConvert does not specify error-numbers if ($iae->getCode() == 100) {
// see https://github.com/phlylabs/idna-convert/issues/11
if (strtolower($iae->getMessage()) == 'this is already a punycode string') {
return $to_encode; return $to_encode;
} }
throw $iae; throw $iae;