mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 06:18:44 +02:00
- Do NOT rely on PHP short open tags, for a better compatibility
- In case of exception, display the whole error string even if it contains HTML tags, sometimes ugly but sometimes VERY useful SVN:trunk[99]
This commit is contained in:
@@ -70,8 +70,7 @@ class Config
|
||||
try
|
||||
{
|
||||
ob_start();
|
||||
$sCode = str_replace('<'.'?php','<'.'?', $sConfigCode);
|
||||
eval('?'.'>'.trim($sCode).'<'.'?');
|
||||
eval('?'.'>'.trim($sConfigCode));
|
||||
$sNoise = trim(ob_get_contents());
|
||||
ob_end_clean();
|
||||
}
|
||||
@@ -84,7 +83,7 @@ class Config
|
||||
if (strlen($sNoise) > 0)
|
||||
{
|
||||
// Note: sNoise is an html output, but so far it was ok for me (e.g. showing the entire call stack)
|
||||
throw new ConfigException('Syntax error in configuration file', array('file' => $sConfigFile, 'error' => $sNoise));
|
||||
throw new ConfigException('Syntax error in configuration file', array('file' => $sConfigFile, 'error' => '<tt>'.htmlentities($sNoise).'</tt>'));
|
||||
}
|
||||
|
||||
if (!isset($MySettings) || !is_array($MySettings))
|
||||
@@ -235,7 +234,7 @@ class Config
|
||||
fwrite($hFile, "\$MySettings = array(\n");
|
||||
fwrite($hFile, "\t'db_host' => '{$this->m_sDBHost}',\n");
|
||||
fwrite($hFile, "\t'db_user' => '{$this->m_sDBUser}',\n");
|
||||
fwrite($hFile, "\t'db_pwd' => '{$this->m_sDBPwd}',\n");
|
||||
fwrite($hFile, "\t'db_pwd' => '".addslashes($this->m_sDBPwd)."',\n");
|
||||
fwrite($hFile, "\t'db_name' => '{$this->m_sDBName}',\n");
|
||||
fwrite($hFile, "\t'db_subname' => '{$this->m_sDBSubname}',\n");
|
||||
fwrite($hFile, ");\n");
|
||||
|
||||
Reference in New Issue
Block a user