Disable hack to Database::escape_string() to avoid SQL injections - partial - refs #7440

1.9.x
Yannick Warnier 11 years ago
parent 28baec78d2
commit 7d4d935372
  1. 4
      main/inc/lib/database.lib.php

@ -472,9 +472,11 @@ class Database
{ {
// Fixes security problem when there's no "" or '' between a variable. // Fixes security problem when there's no "" or '' between a variable.
// See #7440 for more info // See #7440 for more info
/*
if ($addFix) { if ($addFix) {
$string = "__@$string@__"; $string = "__@$string@__";
} }
*/
return get_magic_quotes_gpc() return get_magic_quotes_gpc()
? (self::use_default_connection($connection) ? (self::use_default_connection($connection)
? mysql_real_escape_string(stripslashes($string)) ? mysql_real_escape_string(stripslashes($string))
@ -748,7 +750,7 @@ class Database
$connection = null; $connection = null;
} }
$query = self::fixQuery($query); //$query = self::fixQuery($query);
// Check if the table contains a c_ (means a course id) // Check if the table contains a c_ (means a course id)
if (api_get_setting('server_type') === 'test' && strpos($query, 'c_')) { if (api_get_setting('server_type') === 'test' && strpos($query, 'c_')) {

Loading…
Cancel
Save