summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-25 00:45:13 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-25 00:45:13 +0000
commit1b8d009a5234eda0e46f8ceef5aeeb4939e53078 (patch)
tree1a7901e0b53a3b434eda4a87e63a063e34dc4fac
parent15db230d7da157a0378b2d52ed4c782158d53615 (diff)
Revides the dbquote to use DBI::quote.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@145 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/Form.pm14
-rwxr-xr-xLedgerSMB/IS.pm2
2 files changed, 6 insertions, 10 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 9e2eeb3a..4813411a 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1381,17 +1381,13 @@ sub dbconnect_noauto {
sub dbquote {
- my ($self, $var, $type) = @_;
+ my ($self, $var) = @_;
- # DBI does not return NULL for SQL_DATE if the date is empty
- if ($type eq 'SQL_DATE') {
- $_ = ($var) ? "'$var'" : "NULL";
- }
-
- if ($type eq 'SQL_INT') {
- $_ = $var * 1;
+ if ($var eq ''){
+ $_ = "NULL";
+ } else {
+ $_ = $self->{dbh}->quote($var);
}
-
$_;
}
diff --git a/LedgerSMB/IS.pm b/LedgerSMB/IS.pm
index 1e4714fa..c88d527e 100755
--- a/LedgerSMB/IS.pm
+++ b/LedgerSMB/IS.pm
@@ -998,7 +998,7 @@ sub post_invoice {
my $till = ($form->{till}) ? qq|'$form->{till}'| : "NULL";
$form->{invnumber} = $form->update_defaults($myconfig, "sinumber", $dbh) unless $form->{invnumber};
-
+
# save AR record
$query = qq|UPDATE ar set
invnumber = |.$dbh->quote($form->{invnumber}).qq|,