Skip to content

Commit

Permalink
Fixes to ValidateDecimal and SQLDriver->ApplyParameters (thx unlight)
Browse files Browse the repository at this point in the history
  • Loading branch information
linc committed Sep 16, 2011
1 parent e2a4162 commit f86f20f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/core/functions.validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function ValidateBoolean($Value, $Field) {

if (!function_exists('ValidateDecimal')) {
function ValidateDecimal($Value, $Field) {
if (is_object($Field) && $Field->AllowNull && $Value === '') return TRUE;
if (is_object($Field) && $Field->AllowNull && $Value === NULL) return TRUE;
return is_numeric($Value);
}
}
Expand Down
5 changes: 4 additions & 1 deletion library/database/class.sqldriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ public function AndOp($SetDefault = FALSE) {
return $this;
}

public function ApplyParameters($Sql, $Parameters) {
public function ApplyParameters($Sql, $Parameters = NULL) {
if (!is_array($Parameters))
$Parameters = $this->_NamedParameters;

// Sort the parameters so that we don't have clashes.
krsort($Parameters);
foreach ($Parameters as $Key => $Value) {
Expand Down

0 comments on commit f86f20f

Please sign in to comment.