idna convert the whole URI for uri's in docroot as redirect, fixes #1654

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2016-09-22 07:46:50 +02:00
parent 98c8f519a6
commit 9799e05ce4
4 changed files with 14 additions and 4 deletions

View File

@@ -67,6 +67,16 @@ class idna_convert_wrapper
}
}
public function encode_uri($to_encode)
{
if (version_compare("5.6.0", PHP_VERSION, ">=")) {
return $this->_do_action('encode', $to_encode);
} else {
$to_encode = $this->is_utf8($to_encode) ? $to_encode : utf8_encode($to_encode);
return $this->idna_converter->encodeUri($to_encode);
}
}
/**
* Decode a domain name, a email address or a list of one of both.
*