Index: openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl,v diff -u -r1.191 -r1.192 --- openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 15 Oct 2008 18:23:29 -0000 1.191 +++ openacs-4/packages/xowiki/tcl/xowiki-www-procs.tcl 15 Oct 2008 21:42:41 -0000 1.192 @@ -519,7 +519,7 @@ set vars [list] set sql_clause [list] foreach clause [split [string map [list $logical_op \x00] $input_expr] \x00] { - if {[regexp {^(\w+)\s*([=<>]|<=|>=)\s*([[:alnum:]_|]*)$} $clause _ lhs op rhs_expr]} { + if {[regexp {^(.*[^<>])\s*([=<>]|<=|>=)\s*([^=]?.*)$} $clause _ lhs op rhs_expr]} { set lhs [string trim $lhs] if {[string range $lhs 0 0] eq "_"} { set sql_var [string range $lhs 1 end] Index: openacs-4/packages/xowiki/www/admin/test.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/Attic/test.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/xowiki/www/admin/test.tcl 8 Jul 2008 12:02:15 -0000 1.13 +++ openacs-4/packages/xowiki/www/admin/test.tcl 15 Oct 2008 21:42:41 -0000 1.14 @@ -509,7 +509,21 @@ ? {string first Error $content} -1 "page contains no error" ? {expr {[string first 3: $content]>-1}} 1 "page contains three revisions" +######################################################################## +test section "Small tests" +test subsection "Filter expressions" +? {::xowiki::FormPage filter_expression \ + "_state=created|accepted|approved|tested|developed|deployed&&_assignee=123" &&} \ + "tcl true h {} vars {} sql {{state in ('created','accepted','approved','tested','developed','deployed')} {assignee = '123'}}" filter_expr_where_1 +? {::xowiki::FormPage filter_expression \ + "_assignee<=123 && y>=123" &&} \ + {tcl {$__ia(y) >= {123}} h {} vars {y {}} sql {{assignee <= '{123 }'}}} filter_expr_where_2 +? {::xowiki::FormPage filter_expression \ + "_state= closed|accepted || x = 1" ||} \ + {tcl {$__ia(x) eq {1}} h x=>1 vars {x {}} sql {{state in ('closed','accepted ')}}} filter_expr_unless_1 + + ns_write "