From: Matt S Trout Date: Fri, 1 Nov 2013 08:08:58 +0000 (+0000) Subject: improve identifier regexp in order_by slightly X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c30db4b6a1a8eb78868807de506a301bfc36c3c2;p=dbsrgits%2FSQL-Abstract.git improve identifier regexp in order_by slightly --- diff --git a/lib/SQL/Abstract/Converter.pm b/lib/SQL/Abstract/Converter.pm index d9c6a97..c6480e0 100644 --- a/lib/SQL/Abstract/Converter.pm +++ b/lib/SQL/Abstract/Converter.pm @@ -568,7 +568,11 @@ sub _order_by_to_dq { # dbihacks crack combined with old literal order_by crack # < ribasushi> heh :) - if (my ($ident, $dir) = $$arg =~ /^(\w+)(?:\s+(desc|asc))?$/i) { + # this should take into account our quote char and name sep + + my $match_ident = '\w+(?:\.\w+)*'; + + if (my ($ident, $dir) = $$arg =~ /^(${match_ident})(?:\s+(desc|asc))?$/i) { $dq->{by} = $self->_ident_to_dq($ident); $dq->{reverse} = 1 if $dir and lc($dir) eq 'desc'; } else {