From: Matt S Trout Date: Fri, 20 Apr 2012 11:19:18 +0000 (+0000) Subject: less generous literal parsing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=daf6f8308e38e7c5964d5a4526e9bece95ac9208;p=dbsrgits%2FSQL-Abstract.git less generous literal parsing --- diff --git a/lib/SQL/Abstract/Converter.pm b/lib/SQL/Abstract/Converter.pm index 78a4292..eab3e4e 100644 --- a/lib/SQL/Abstract/Converter.pm +++ b/lib/SQL/Abstract/Converter.pm @@ -575,7 +575,7 @@ sub _order_by_to_dq { } elsif (ref($arg) eq 'REF' and ref($$arg) eq 'ARRAY') { $dq->{by} = $self->_literal_to_dq($$arg); } elsif (ref($arg) eq 'SCALAR') { - if (my ($ident, $dir) = $$arg =~ /^(\w+)(?:\s+(desc|asc))?/i) { + if (my ($ident, $dir) = $$arg =~ /^(\w+)(?:\s+(desc|asc))?$/i) { $dq->{by} = $self->_ident_to_dq($ident); $dq->{reverse} = 1 if $dir and lc($dir) eq 'desc'; } else {