From: stronk7 Date: Sun, 27 Aug 2006 21:57:33 +0000 (+0000) Subject: Set magic_quotes_sybase for both mssql and oci8po. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3655a6b39f8b0faa3f21ff6d08ba357912c92d8e;p=moodle.git Set magic_quotes_sybase for both mssql and oci8po. Anyway, this isn't enough and if must be defined in php.ini or .htaccess, because GPC are added BEFORE this setting has effect so they are slashed with the default char. --- diff --git a/lib/dmllib.php b/lib/dmllib.php index 765d792f46..ef350fd4af 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -1336,21 +1336,29 @@ function configure_dbconnection() { if ($CFG->unicodedb) { $db->Execute("SET NAMES 'utf8'"); } - break; + break; case 'postgres7': /// Set names if needed if ($CFG->unicodedb) { $db->Execute("SET NAMES 'utf8'"); } - break; + break; case 'mssql': /// No need to set charset. It must be specified in the driver conf /// Allow quoted identifiers $db->Execute('SET QUOTED_IDENTIFIER ON'); - break; - case 'oracle': + /// Enable sybase quotes, so addslashes and stripslashes will use "'" + ini_set('magic_quotes_sybase', '1'); + /// NOTE: Not 100% useful because GPC has been addslashed with the setting off + /// so IT'S MANDATORY TO CHANGE THIS UNDER php.ini or .htaccess for this DB + break; + case 'oci8po': /// No need to set charset. It must be specified by the NLS_LANG env. variable - break; + /// Enable sybase quotes, so addslashes and stripslashes will use "'" + ini_set('magic_quotes_sybase', '1'); + /// NOTE: Not 100% useful because GPC has been addslashed with the setting off + /// so IT'S MANDATORY TO ENABLE THIS UNDER php.ini or .htaccess for this DB + break; } }