[Rt-commit] rt branch, 4.2/autocomplete-watcher-group, created. rt-4.1.17-43-g60d5768

Alex Vandiver alexmv at bestpractical.com
Wed Jul 17 22:54:06 EDT 2013


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

- Log -----------------------------------------------------------------
commit 1fe8d0620b7dc1d36dac13bca0153f2d9a132983
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..d9db2d6 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->{id} ||= $box->{name} ||= $name;
+        $box->{value} ||= delete($box->{Default}) || '';
+        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 60d5768fb805c60b12bbc4702c3c6e728d8f91a5
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