[Rt-commit] rt branch, 4.2/autocomplete-watcher-group, created. rt-4.1.13-24-g77aff21

Alex Vandiver alexmv at bestpractical.com
Tue Jun 18 21:47:03 EDT 2013


The branch, 4.2/autocomplete-watcher-group has been created
        at  77aff2179c9f15ac0b39e9837783e6c2bde67159 (commit)

- Log -----------------------------------------------------------------
commit 6a31b6477cb0e802aa30217e47917f9208923259
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Jun 18 18:40:50 2013 -0700

    Add all attributes that are supplied, rather than piecemeal
    
    This allows for greater extensibility.  At the same time, bullet-proof
    the keys and values to prevent possible future security vulnerabilities;
    while at current the keys and values are static and not generated based
    on any user input, this prevents callbacks from unintentionally opening
    up such vulnerabilities.

diff --git a/share/html/Search/Elements/ConditionRow b/share/html/Search/Elements/ConditionRow
index 95132f7..6b7125c 100644
--- a/share/html/Search/Elements/ConditionRow
+++ b/share/html/Search/Elements/ConditionRow
@@ -74,9 +74,11 @@ $handle_block = sub {
         return $m->scomp( $box->{'Path'}, %{ $box->{'Arguments'} }, Name => $name );
     }
     if ( $box->{'Type'} eq 'text' ) {
-        my $default = $box->{'Default'} || '';
-        my $size = $box->{'Size'}? qq{size="$box->{'Size'}"} : '';
-        return qq{<input id="$name" name="$name" value="$default" $size />};
+        $box->{'Default'} ||= '';
+        $box->{id} ||= $box->{name} ||= $name;
+        return "<input ".join(" ", map{$m->interp->apply_escapes(lc($_),'h')
+                                      .q{="}.$m->interp->apply_escapes($box->{$_},'h').q{"}}
+                                   sort keys %$box)." />";
     }
     if ( $box->{'Type'} eq 'select' ) {
         my $res = '';

commit 77aff2179c9f15ac0b39e9837783e6c2bde67159
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Jun 18 18:46:58 2013 -0700

    Autocomplete group names for watcher group searching

diff --git a/share/html/Search/Elements/PickBasics b/share/html/Search/Elements/PickBasics
index a58ddb4..71c86ee 100644
--- a/share/html/Search/Elements/PickBasics
+++ b/share/html/Search/Elements/PickBasics
@@ -151,7 +151,7 @@ my @lines = (
             Type => 'select',
             Options => [ '=' => loc('is') ],
         },
-        Value => { Type => 'text', Size => 20 }
+        Value => { Type => 'text', Size => 20, "data-autocomplete" => "Groups" }
     },
     {
         Name => 'Date',

-----------------------------------------------------------------------


More information about the Rt-commit mailing list