]> git.mjollnir.org Git - moodle.git/commitdiff
testing forced conversion to proper numeric type in _adodb_column_sql() SC#259
authorskodak <skodak>
Tue, 5 Sep 2006 23:59:25 +0000 (23:59 +0000)
committerskodak <skodak>
Tue, 5 Sep 2006 23:59:25 +0000 (23:59 +0000)
lib/adodb/adodb-lib.inc.php
lib/adodb/readme_moodle.txt

index 51c45c716782cd49f37af23afd99f576fb78981e..0aaaa23cd2584ca10b58239505a3dded44fe4726 100644 (file)
@@ -507,7 +507,7 @@ function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page,
        return $rsreturn;
 }
 
-// Iván Oliva version
+// Ivn Oliva version
 function &_adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0) 
 {
 
@@ -963,7 +963,19 @@ function _adodb_column_sql(&$zthis, $action, $type, $fname, $fnameq, $arrFields,
                        $val = $zthis->DBTimeStamp($arrFields[$fname]);
                        break;
 
-               default:
+// moodle change start - see readme_moodle.txt
+        case "L": //Integer field suitable for storing booleans (0 or 1)
+        case "I": //Integer
+            $val = (int)$arrFields[$fname];
+            break;
+
+        case "F": //Floating point number
+        case "N": //Numeric or decimal number
+            $val = (float)$arrFields[$fname];
+            break;
+// moodle change end
+
+        default:
                        $val = $arrFields[$fname];
                        if (empty($val)) $val = '0';
                        break;
index c25cdd0e5a37d0c6d993bfd09c81a8fc16168285..724c5238251439780ab05a563eb9e5ffa823b53e 100644 (file)
@@ -12,5 +12,8 @@ Added:
  * tests/tmssql.php - detection of attack attempts and overwrite on incorrectly upgraded sites
  * readme_moodle.txt - this file ;-)
 
+Our changes:
+ * adodb-lib.inc.php - forced conversion to proper numeric type in _adodb_column_sql()
 skodak
 30 August 2006
\ No newline at end of file