Fix #1037 IDN in Javascript @misol

This commit is contained in:
Kijin Sung 2018-05-30 21:26:05 +09:00
parent 4f35512241
commit 83fe72be18
2 changed files with 4 additions and 4 deletions

View file

@ -38,7 +38,7 @@ class URL
public static function getCurrentDomainURL($path = '/')
{
$proto = \RX_SSL ? 'https://' : 'http://';
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
$host = isset($_SERVER['HTTP_HOST']) ? self::decodeIdna($_SERVER['HTTP_HOST']) : 'localhost';
return $proto . $host . '/' . ltrim($path, '/');
}

View file

@ -48,9 +48,9 @@
<!-- COMMON JS VARIABLES -->
<script>
var default_url = "{Context::getDefaultUrl()}";
var current_url = "{$current_url}";
var request_uri = "{$request_uri}";
var default_url = "{\Rhymix\Framework\URL::encodeIdna(Context::getDefaultUrl())}";
var current_url = "{\Rhymix\Framework\URL::encodeIdna($current_url)}";
var request_uri = "{\Rhymix\Framework\URL::encodeIdna($request_uri)}";
var current_lang = xe.current_lang = "{$lang_type}";
var current_mid = {json_encode($mid ?: null)};
var http_port = {Context::get("_http_port") ?: 'null'};