Merge branch 'ent-8056-12473-Funcion-get-magic-quotes-gpc-hace-fallar-snmp-browser-para-PHP-7-4-o-superior' into 'develop'
removed deprecated get_magic_quotes_gpc function and dependent code See merge request artica/pandorafms!4439
This commit is contained in:
commit
69216e1bcf
|
@ -1291,23 +1291,6 @@ function mysql_db_process_sql_rollback()
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Put quotes if magic_quotes protection
|
||||
*
|
||||
* @param string Text string to be protected with quotes if magic_quotes protection is disabled
|
||||
*/
|
||||
function mysql_safe_sql_string($string)
|
||||
{
|
||||
if (get_magic_quotes_gpc() == 0) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
global $config;
|
||||
|
||||
return mysql_real_escape_string($config['dbconnection'], $string);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get last error.
|
||||
*
|
||||
|
|
|
@ -1496,21 +1496,6 @@ function oracle_db_process_sql_rollback()
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Put quotes if magic_quotes protection
|
||||
*
|
||||
* @param string Text string to be protected with quotes if magic_quotes protection is disabled
|
||||
*/
|
||||
function oracle_safe_sql_string($string)
|
||||
{
|
||||
if (get_magic_quotes_gpc() == 0) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
return oracle_escape_string_sql($string);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get last error.
|
||||
*
|
||||
|
|
|
@ -1098,23 +1098,6 @@ function postgresql_db_process_sql_rollback()
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Put quotes if magic_quotes protection
|
||||
*
|
||||
* @param string Text string to be protected with quotes if magic_quotes protection is disabled
|
||||
*/
|
||||
function postgresql_safe_sql_string($string)
|
||||
{
|
||||
if (get_magic_quotes_gpc() == 0) {
|
||||
return $string;
|
||||
}
|
||||
|
||||
global $config;
|
||||
|
||||
return pg_escape_string($config['dbconnection'], $string);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get last error.
|
||||
*
|
||||
|
|
|
@ -1689,32 +1689,6 @@ if (!function_exists('mb_strtoupper')) {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Put quotes if magic_quotes protection
|
||||
*
|
||||
* @param string Text string to be protected with quotes if magic_quotes protection is disabled
|
||||
*/
|
||||
function safe_sql_string($string)
|
||||
{
|
||||
global $config;
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
return mysql_safe_sql_string($string);
|
||||
|
||||
break;
|
||||
case 'postgresql':
|
||||
return postgresql_safe_sql_string($string);
|
||||
|
||||
break;
|
||||
case 'oracle':
|
||||
return oracle_safe_sql_string($string);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verifies if current Pandora FMS installation is a Metaconsole.
|
||||
*
|
||||
|
|
|
@ -1162,7 +1162,6 @@ function alerts_duplicate_alert_template($id_alert_template, $id_group)
|
|||
unset($template['name']);
|
||||
unset($template['id']);
|
||||
unset($template['type']);
|
||||
$template['value'] = safe_sql_string($template['value']);
|
||||
|
||||
return alerts_create_alert_template($name, $type, $template);
|
||||
}
|
||||
|
|
|
@ -82,11 +82,6 @@ function io_safe_input($value)
|
|||
return $value;
|
||||
}
|
||||
|
||||
// Clean the trash mix into string because of magic quotes.
|
||||
if (get_magic_quotes_gpc() == 1) {
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
|
||||
if (! mb_check_encoding($value, 'UTF-8')) {
|
||||
$value = utf8_encode($value);
|
||||
}
|
||||
|
@ -158,11 +153,6 @@ function io_safe_input_html($value)
|
|||
return $value;
|
||||
}
|
||||
|
||||
// Clean the trash mix into string because of magic quotes.
|
||||
if (get_magic_quotes_gpc() == 1) {
|
||||
$value = stripslashes($value);
|
||||
}
|
||||
|
||||
if (! mb_check_encoding($value, 'UTF-8')) {
|
||||
$value = utf8_encode($value);
|
||||
}
|
||||
|
@ -380,21 +370,6 @@ function io_safe_output_xml($string)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Avoid magic_quotes protection
|
||||
*
|
||||
* @param string Text string to be stripped of magic_quotes protection
|
||||
*/
|
||||
function io_unsafe_string($string)
|
||||
{
|
||||
if (get_magic_quotes_gpc()) {
|
||||
return stripslashes($string);
|
||||
}
|
||||
|
||||
return $string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a translated string
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue