Refactor more URL related functions

This commit is contained in:
Kijin Sung 2016-01-20 15:53:42 +09:00
parent a8094fe766
commit 08560f84be
5 changed files with 9 additions and 15 deletions

View file

@ -63,8 +63,7 @@ class image_link extends EditorHandler
if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2);
else if(substr($src , 0, 1)=='/')
{
if($_SERVER['HTTPS']=='on') $http_src = 'https://';
else $http_src = 'http://';
$http_src = RX_SSL ? 'https://' : 'http://';
$src = $http_src.$_SERVER['HTTP_HOST'].$src;
}
else if(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src;

View file

@ -153,7 +153,7 @@ class installView extends install
Context::set('progressMenu', '4');
$error_return_url = getNotEncodedUrl('', 'act', Context::get('act'), 'db_type', Context::get('db_type'));
if($_SERVER['HTTPS'] == 'on')
if(RX_SSL)
{
// Error occured when using https protocol at "ModuleHandler::init() '
$parsedUrl = parse_url($error_return_url);
@ -182,7 +182,7 @@ class installView extends install
include _XE_PATH_.'files/config/tmpDB.config.php';
Context::set('use_rewrite', $_SESSION['use_rewrite']);
Context::set('use_ssl', $_SERVER['HTTPS'] === 'on' ? 'always' : 'none');
Context::set('use_ssl', RX_SSL ? 'always' : 'none');
Context::set('time_zone', $GLOBALS['time_zone']);
Context::set('db_type', $db_info->db_type);
$this->setTemplateFile('admin_form');

View file

@ -157,8 +157,7 @@ class rssView extends rss
break;
}
if($_SERVER['HTTPS']=='on') $proctcl = 'https://';
else $proctcl = 'http://';
$proctcl = RX_SSL ? 'https://' : 'http://';
$temp_link = explode('/', $info->link);
if($temp_link[0]=='' && $info->link)