Refactor some URL related functions to use Rhymix constants

This commit is contained in:
Kijin Sung 2016-01-20 15:45:18 +09:00
parent 9ddf2f54f3
commit a8094fe766
3 changed files with 16 additions and 55 deletions

View file

@ -457,9 +457,7 @@ function getFullSiteUrl()
*/
function getCurrentPageUrl()
{
$protocol = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
$url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
return htmlspecialchars($url, ENT_COMPAT, 'UTF-8', FALSE);
return escape((RX_SSL ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
}
/**
@ -1213,12 +1211,7 @@ function mysql_pre4_hash_password($password)
*/
function getScriptPath()
{
static $url = NULL;
if($url == NULL)
{
$url = str_ireplace('/tools/', '/', preg_replace('/index.php$/i', '', str_replace('\\', '/', $_SERVER['SCRIPT_NAME'])));
}
return $url;
return RX_BASEURL;
}
/**