[prev] [thread] [next] [lurker] [Date index for 2002/09/15]
Update of /cvsroot/siesta/siesta/lib/Siesta/Storage In directory usw-pr-cvs1:/tmp/cvs-serv30106 Modified Files: DBI.pm Log Message: quote properly Index: DBI.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Storage/DBI.pm,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- DBI.pm 15 Sep 2002 12:13:15 -0000 1.28 +++ DBI.pm 15 Sep 2002 12:30:09 -0000 1.29 @@ -35,18 +35,18 @@ my %where = %{ $args{where} || {} }; my @columns = @{ $args{columns} }; + my $dbh = $self->_dbh; my $sql = "SELECT " . join ( ', ', @columns ) . " FROM $args{table}"; - $sql .= join ( '', - " WHERE ", - join ( ' AND ', map { "$_ = '$where{$_}'" } keys %where ) ) - if %where; + $sql .= " WHERE " . + join ( ' AND ', map { "$_ = " . $dbh->quote( $where{$_} ) } keys %where ) + if %where; return map { my %foo; @foo{@columns} = @$_; \%foo; - } @{ $self->_dbh->selectall_arrayref($sql) }; + } @{ $dbh->selectall_arrayref($sql) }; } sub _update_or_insert {
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52