From 1ce5e4ebab38216766224420d8f77d095abcbb17 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 13 Jan 2010 16:42:29 -0800 Subject: [PATCH] Give SQL.pm a quote_identifier wrapper. --- lib/WebGUI/SQL.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/WebGUI/SQL.pm b/lib/WebGUI/SQL.pm index 37720f702..0b9e483d0 100644 --- a/lib/WebGUI/SQL.pm +++ b/lib/WebGUI/SQL.pm @@ -861,6 +861,24 @@ sub quoteAndJoin { } +#------------------------------------------------------------------- + +=head2 quoteIdentifier ( string ) + +Returns a string quoted as an identifier to be used as a table name, column name, etc. + +=head3 string + +Any scalar variable that needs to be escaped to be inserted into the database. + +=cut + +sub quoteIdentifier { + my $self = shift; + my $value = shift; + return $self->dbh->quote_identifier($value); +} + #------------------------------------------------------------------- =head2 read ( sql [ , placeholders ] )