From: Sven Schöling Date: Tue, 27 Feb 2007 16:09:15 +0000 (+0000) Subject: Quoting Funktion für Datumsangaben in sql queries. X-Git-Tag: release-2.4.3^2~656 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/commitdiff_plain/635dd08dccc18b6eb5645d55ab4adf3ab8216f6a Quoting Funktion für Datumsangaben in sql queries. Beherrscht: - NULL fuer nicht definierte Werte - current_date als Schlüsselwort - Standardquoting fuer tainted strings (übernommen aus DBI.pm) --- diff --git a/SL/Form.pm b/SL/Form.pm index 0e59786d9..6a73aa415 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -239,6 +239,15 @@ sub quote_html { return $str; } +sub quote_db_date { + $main::lxdebug->enter_sub(2) and my ($self, $str) = @_; + $main::lxdebug->leave_sub(2) and return "NULL" unless defined $str; + $main::lxdebug->leave_sub(2) and return "current_date" if $str =~ /current_date/; + $str =~ s/'/''/g; + $main::lxdebug->leave_sub(2) and return "'$str'"; +} + + sub hide_form { my $self = shift;