Skip to content

Commit

Permalink
Item13122: add mysql-safeId-sign to regex
Browse files Browse the repository at this point in the history
removed boolean where expression - threw MySql-Error
use META:FORM for undefined queries
  • Loading branch information
prmdhost authored and gac410 committed Nov 28, 2014
1 parent 74d36a5 commit 9ebb0c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Foswiki/Contrib/DBIStoreContrib/HoistSQL.pm
Expand Up @@ -125,7 +125,7 @@ sub _AS {
while ( my ( $what, $alias ) = each %args ) {
if ( defined $alias ) {
$what = "($what)"
if $what !~ /^\w+$/
if $what !~ /^[\w`]+$/
&& $what !~ /^(["']).*\1$/
&& $what !~ /^\([^()]*\)$/;
push( @terms, "$what AS $alias" );
Expand Down Expand Up @@ -686,7 +686,7 @@ sub _hoist {
);
my $where = "($lhs_alias.tid=$rhs_alias.tid)";
if ( $optype == BOOLEAN ) {
$where .= " AND ($expr)";
#$where .= " AND ($expr)";
$expr = $TRUE;
$optype = $TRUE_TYPE;
}
Expand Down Expand Up @@ -890,7 +890,7 @@ sub _rewrite {
else {
$node = _rewrite(
$parser->parse(
"META:FIELD[name='$node->{params}[0]'].value"),
"META:FORM[name='$node->{params}[0]']"),
$context
);
$rewrote = __LINE__;
Expand Down

0 comments on commit 9ebb0c5

Please sign in to comment.