Merge pull request #614 from julceslauhub/master
Add validation in class serverConfiguration
This commit is contained in:
@@ -1208,9 +1208,13 @@ class G
|
|||||||
G::LoadClass('serverConfiguration');
|
G::LoadClass('serverConfiguration');
|
||||||
$oServerConf =& serverConf::getSingleton();
|
$oServerConf =& serverConf::getSingleton();
|
||||||
if (!(defined('SYS_LANG'))) {
|
if (!(defined('SYS_LANG'))) {
|
||||||
$syss = explode('://', $_SERVER['HTTP_REFERER']);
|
if (isset($_SERVER['HTTP_REFERER'])) {
|
||||||
$sysObjets = explode('/', $syss['1']);
|
$syss = explode('://', $_SERVER['HTTP_REFERER']);
|
||||||
$sysLang = $sysObjets['2'];
|
$sysObjets = explode('/', $syss['1']);
|
||||||
|
$sysLang = $sysObjets['2'];
|
||||||
|
} else {
|
||||||
|
$sysLang = 'en';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$sysLang = SYS_LANG;
|
$sysLang = SYS_LANG;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,10 +55,13 @@ class serverConf {
|
|||||||
private $lanLanguage;
|
private $lanLanguage;
|
||||||
public $workspaces = array();
|
public $workspaces = array();
|
||||||
public $rtlLang = array('ar','iw','fa');
|
public $rtlLang = array('ar','iw','fa');
|
||||||
|
public $filePath = '';
|
||||||
|
|
||||||
|
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->filePath = PATH_DATA . 'srvConf.singleton';
|
if (defined('PATH_DATA')) {
|
||||||
|
$this->filePath = PATH_DATA . 'srvConf.singleton';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,8 +110,10 @@ class serverConf {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function saveSingleton() {
|
function saveSingleton() {
|
||||||
$this->filePath = PATH_DATA . 'srvConf.singleton';
|
if (defined('PATH_DATA')) {
|
||||||
$size = file_put_contents ( $this->filePath, $this->serializeInstance () );
|
$this->filePath = PATH_DATA . 'srvConf.singleton';
|
||||||
|
$size = file_put_contents ( $this->filePath, $this->serializeInstance () );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user