* Add enclair_db option to UserDB.pm. Allows logging of enclair password
[interchange.git] / code / Filter / dbi_quote.filter
1 # Copyright 2005-2007 Interchange Development Group and others
2
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.  See the LICENSE file for details.
7
8 # $Id: dbi_quote.filter,v 1.3 2007-03-30 23:40:44 pajamian Exp $
9
10 CodeDef dbi_quote Filter
11 CodeDef dbi_quote Description SQL quoting using DBI
12 CodeDef dbi_quote Routine <<EOR
13 sub {
14         my ($val, $tag, $table) = @_;
15
16         $table ||= $Vend::Cfg->{ProductFiles}[0];
17
18         my $db;
19         unless ($db = dbref($table)) {
20                 ::logError("filter dbi_quote cannot find database handle for table '%s'", $table);
21                 return;
22         }
23
24         return $db->quote($val);
25 }
26 EOR