fixing serv_name value with proper protocol

This commit is contained in:
2016-03-20 22:40:57 +01:00
parent ddd2968d23
commit f3d4e01779
2 changed files with 2 additions and 3 deletions

View File

@@ -2627,7 +2627,7 @@ class Databap extends PhpObject
private static function getLoginToken($sPass)
{
return md5($sPass.$_GET['serv_name']);
return md5($sPass.str_replace('https://', 'http://', $_GET['serv_name']));
}
public function checkSetPass($sToken, $sNewToken)

View File

@@ -40,9 +40,8 @@ class ToolBox
$_REQUEST = array_merge($_GET, $_REQUEST);
//Add Server Name
//FIXME http/https value
$sServerName = array_key_exists('SERVER_NAME', $_SERVER)?$_SERVER['SERVER_NAME']:$_SERVER['PWD'];
$sAppPath = 'http://'.str_replace(array('http://', 'https://'), '', $sServerName.dirname($_SERVER['SCRIPT_NAME']));
$sAppPath = $_SERVER['REQUEST_SCHEME'].str_replace(array('http://', 'https://'), '', $sServerName.dirname($_SERVER['SCRIPT_NAME']));
$_GET['serv_name'] = $sAppPath.(mb_substr($sAppPath, -1)!='/'?'/':'');
}