[Rt-commit] rt branch, 4.0/escape-quotes-in-search-format, repushed

? sunnavy sunnavy at bestpractical.com
Tue Oct 8 07:16:43 EDT 2013


The branch 4.0/escape-quotes-in-search-format was deleted and repushed:
       was 5782144c9557561ec66fa1146f00e3f0fb8242de
       now 420b0fe46bb5c61fb790f7dc31c6fd76e8c74a5e

1:  5782144 ! 1:  420b0fe handle quotes in search format
    @@ -1,46 +1,23 @@
     Author: sunnavy <sunnavy at bestpractical.com>
     
    -    escape quotes for custom field in search results
    +    handle quotes in search format
         
         previously we don't handle it at all, so the format is like
         '__CustomField.{foo's bar}__', which breaks the parse logic badly.
         
         with this fix, the format will be like '__CustomField.{foo\'s bar}__'
     
    -diff --git a/share/html/Elements/CollectionAsTable/Header b/share/html/Elements/CollectionAsTable/Header
    ---- a/share/html/Elements/CollectionAsTable/Header
    -+++ b/share/html/Elements/CollectionAsTable/Header
    +diff --git a/share/html/Elements/CollectionAsTable/ParseFormat b/share/html/Elements/CollectionAsTable/ParseFormat
    +--- a/share/html/Elements/CollectionAsTable/ParseFormat
    ++++ b/share/html/Elements/CollectionAsTable/ParseFormat
     @@
    -     } else {
    -         $title = $m->comp('/Elements/ScrubHTML', Content => $title);
    +     if ($col =~ /^$RE{quoted}$/o) {
    +         substr($col,0,1) = "";
    +         substr($col,-1,1) = "";
    ++        $col =~ s/\\(.)/$1/g;
          }
    -+    $title =~ s!\\(.)!$1!g;
      
    -     if ( $AllowSorting and $col->{'attribute'}
    -         and my $attr = $m->comp(
    -
    -diff --git a/share/html/Elements/ColumnMap b/share/html/Elements/ColumnMap
    ---- a/share/html/Elements/ColumnMap
    -+++ b/share/html/Elements/ColumnMap
    -@@
    -         value     => sub {
    -             # Cache the CF object on a per-request basis, to avoid
    -             # having to load it for every row
    -+            my $name = $_[-1];
    -+            $name =~ s!\\(.)!$1!g;
    -             my $key = join("-","CF",
    -                            $_[0]->CustomFieldLookupType,
    -                            $_[0]->CustomFieldLookupId,
    --                           $_[-1]);
    -+                           $name);
    - 
    -             my $cf = $m->notes($key);
    -             unless ($cf) {
    --                $cf = $_[0]->LoadCustomFieldByIdentifier($_[-1]);
    -+                $cf = $_[0]->LoadCustomFieldByIdentifier($name);
    -                 $m->notes($key, $cf);
    -             }
    - 
    +     my $colref = { };
     
     diff --git a/share/html/Search/Elements/EditFormat b/share/html/Search/Elements/EditFormat
     --- a/share/html/Search/Elements/EditFormat



More information about the Rt-commit mailing list