]> git.mjollnir.org Git - moodle.git/commitdiff
Set magic_quotes_sybase for both mssql and oci8po.
authorstronk7 <stronk7>
Sun, 27 Aug 2006 21:57:33 +0000 (21:57 +0000)
committerstronk7 <stronk7>
Sun, 27 Aug 2006 21:57:33 +0000 (21:57 +0000)
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.

lib/dmllib.php

index 765d792f46e5991334406803df1d4173e0d607d9..ef350fd4afdb22ba733ffe853d750e74f452ff9e 100644 (file)
@@ -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;
     }
 }