Changeset 2607


Ignore:
Timestamp:
04/17/24 18:06:58 (2 weeks ago)
Author:
nanardon
Message:

Allow to clearly split operator from text using space in filter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/lib/LATMOS/Accounts/Bases/Sql/objects.pm

    r2548 r2607  
    11291129        # attr=foo => no extra white space ! 
    11301130        # \W is false, it is possible to have two char 
    1131         my ($OpFilter, $attr, $attrref, $operator, $val) = $item =~ /^([\!\+\-]?)(\w+)(?:\.([\.\w]+))?(?:([^\w*\\]+)(.+))?$/ or next; 
     1131        my ($OpFilter, $attr, $attrref, $operator, $val) = $item =~ /^([\!\+\-]?)\s*(\w+)(?:\.([\.\w]+))?\s*(?:([^\w\s\\]+)\s*(.+))?$/ or next; 
     1132 
    11321133        if (!$operator) { 
    11331134            $operator = '~'; 
     
    11661167 
    11671168            $attrKey .= '.' . $attrref; 
    1168             my @results = $base->search_objects($otype, "$attrref$operator$val"); 
     1169            my @results = $base->search_objects($otype, "$attrref $operator $val"); 
    11691170            $base->log(LA_DEBUG, "Sub search %s res: %s", $otype, join(', ', @results)); 
    11701171 
Note: See TracChangeset for help on using the changeset viewer.