diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index eab86b07136..96348c2e272 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -253,28 +253,7 @@ foreach ($handlers as $handler) if (empty($conf->loghandlers[$handler])) $conf->loghandlers[$handler]=$loghandlerinstance; } -// Removed magic_quotes -if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* removed in PHP 5.4 -{ - if (get_magic_quotes_gpc()) - { - // Forcing parameter setting magic_quotes_gpc and cleaning parameters - // (Otherwise he would have for each position, condition - // Reading stripslashes variable according to state get_magic_quotes_gpc). - // Off mode (recommended, you just do $db->escape when an insert / update. - function stripslashes_deep($value) - { - return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value)); - } - $_GET = array_map('stripslashes_deep', $_GET); - $_POST = array_map('stripslashes_deep', $_POST); - $_COOKIE = array_map('stripslashes_deep', $_COOKIE); - $_REQUEST = array_map('stripslashes_deep', $_REQUEST); - @set_magic_quotes_runtime(0); - } -} - -// Defini objet langs +// Define object $langs $langs = new Translate('..', $conf); if (GETPOST('lang', 'aZ09')) $langs->setDefaultLang(GETPOST('lang', 'aZ09')); else $langs->setDefaultLang('auto'); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index e551280f90f..2e9ec140bf7 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -47,27 +47,6 @@ if (! empty($_SERVER['MAIN_SHOW_TUNING_INFO'])) } } -// Removed magic_quotes -if (function_exists('get_magic_quotes_gpc')) // magic_quotes_* deprecated in PHP 5.0 and removed in PHP 5.5 -{ - if (get_magic_quotes_gpc()) - { - // Forcing parameter setting magic_quotes_gpc and cleaning parameters - // (Otherwise he would have for each position, condition - // Reading stripslashes variable according to state get_magic_quotes_gpc). - // Off mode recommended (just do $db->escape for insert / update). - function stripslashes_deep($value) - { - return (is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value)); - } - $_GET = array_map('stripslashes_deep', $_GET); - $_POST = array_map('stripslashes_deep', $_POST); - $_FILES = array_map('stripslashes_deep', $_FILES); - //$_COOKIE = array_map('stripslashes_deep', $_COOKIE); // Useless because a cookie should never be outputed on screen nor used into sql - @set_magic_quotes_runtime(0); - } -} - /** * Security: SQL Injection and XSS Injection (scripts) protection (Filters on GET, POST, PHP_SELF). *