diff --git a/config-dist.php b/config-dist.php index e11eeb1..38c7253 100644 --- a/config-dist.php +++ b/config-dist.php @@ -125,6 +125,16 @@ $CFG->directorypermissions = 02777; $CFG->admin = 'admin'; +// If using Oracle, specify the characters to use as the decimal separator and +// group separator. The decimal separator separates the integer portion of a +// number from the decimal portion. The group separator separates integer groups +// (that is, thousands, millions, billions, and so on). If not specified, Moodle +// will use '.' as the decimal separator and ',' as the group separator by default. +// +// See http://download.oracle.com/docs/cd/B14117_01/server.101/b10755/initparams130.htm +// for additional details. +// $CFG->oraclenlsnumchars = '.,'; + //========================================================================= // 7. OTHER MISCELLANEOUS SETTINGS (ignore these for new installations) //========================================================================= diff --git a/lib/dmllib.php b/lib/dmllib.php index 8a890db..49c99dc 100644 --- a/lib/dmllib.php +++ b/lib/dmllib.php @@ -2137,6 +2137,10 @@ function configure_dbconnection() { /// No need to set charset. It must be specified by the NLS_LANG env. variable /// Enable sybase quotes, so addslashes and stripslashes will use "'" ini_set('magic_quotes_sybase', '1'); + /// MDL-11629 + $db->Execute("ALTER SESSION SET NLS_NUMERIC_CHARACTERS='" . + (isset($CFG->oraclenlsnumchars) ? + $CFG->oraclenlsnumchars : '.,') . "'"); /// 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 /// or to turn off magic_quotes to allow Moodle to do it properly