Skip to content

Commit

Permalink
testing forced conversion to proper numeric type in _adodb_column_sql…
Browse files Browse the repository at this point in the history
…() SC#259
  • Loading branch information
skodak committed Sep 5, 2006
1 parent 9eabd19 commit c3768df
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/adodb/adodb-lib.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ function &_adodb_pageexecute_all_rows(&$zthis, $sql, $nrows, $page,
return $rsreturn;
}

// Iván Oliva version
// Iv�n Oliva version
function &_adodb_pageexecute_no_last_page(&$zthis, $sql, $nrows, $page, $inputarr=false, $secs2cache=0)
{

Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions lib/adodb/readme_moodle.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c3768df

Please sign in to comment.