mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-04 07:58:46 +02:00
N°3952 - code hardening
This commit is contained in:
@@ -147,12 +147,7 @@ header("Expires: Fri, 17 Jul 1970 05:00:00 GMT"); // Date in the past
|
||||
$sOperation = Utils::ReadParam('operation', '');
|
||||
try
|
||||
{
|
||||
$sAuthent = utils::ReadParam('authent', '', false, 'raw_data');
|
||||
if (!file_exists(APPROOT.'data/setup/authent') || $sAuthent !== file_get_contents(APPROOT.'data/setup/authent'))
|
||||
{
|
||||
throw new SecurityException('Setup operations are not allowed outside of the setup');
|
||||
SetupPage::log_error("Setup operations are not allowed outside of the setup");
|
||||
}
|
||||
SetupUtils::CheckSetupToken();
|
||||
|
||||
switch($sOperation)
|
||||
{
|
||||
@@ -199,7 +194,6 @@ catch(Exception $e)
|
||||
{
|
||||
header("HTTP/1.0 500 Internal server error.");
|
||||
echo "<p>An error happened while processing the installation:</p>\n";
|
||||
echo '<p>'.$e."</p>\n";
|
||||
SetupPage::log_error("An error happened while processing the installation: ".$e);
|
||||
}
|
||||
|
||||
@@ -207,7 +201,7 @@ if (function_exists('memory_get_peak_usage'))
|
||||
{
|
||||
if ($sOperation == 'file')
|
||||
{
|
||||
SetupPage::log_info("loading file '$sFileName', peak memory usage. ".memory_get_peak_usage());
|
||||
SetupPage::log_info("loading file peak memory usage. ".memory_get_peak_usage());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user