diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index eb0d07e0f8..d364d68431 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2011-03-02 Miguel de Dios + + * include/db/postgresql.php, include/db/mysql.php, include/functions.php: + separate the function "mysql_safe_sql_string" into the two version for MySQL + and PostgreSQL engine. + 2011-03-02 Miguel de Dios * include/db/postgresql.php: fixed in the function diff --git a/pandora_console/include/db/mysql.php b/pandora_console/include/db/mysql.php index 15acb22cfd..3e48c5a752 100644 --- a/pandora_console/include/db/mysql.php +++ b/pandora_console/include/db/mysql.php @@ -936,4 +936,18 @@ function mysql_process_sql_rollback() { mysql_query ('ROLLBACK '); mysql_query ('SET AUTOCOMMIT = 0'); } + +/** + * 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($string, $config['dbconnection']); +} ?> \ No newline at end of file