[Bps-public-commit] rt-extension-formtools branch, master, updated. 0.16-5-g161e534
Alex Vandiver
alexmv at bestpractical.com
Wed May 28 12:39:34 EDT 2014
The branch, master has been updated
via 161e5345f20b35029b666b4d4b7de057203d7792 (commit)
via 8b802f7bc967827f3d3415428026e61d364e92b5 (commit)
from 90a73ae5ea7026f1fc4aec21cac22c9b09c1ccd9 (commit)
Summary of changes:
html/FormTools/Form | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
- Log -----------------------------------------------------------------
commit 8b802f7bc967827f3d3415428026e61d364e92b5
Author: Matt Zagrabelny <mzagrabe at d.umn.edu>
Date: Fri May 16 20:31:40 2014 -0500
add "name" parameter to HTML form element
Add a bit more flexibility to FormTools/Form component. It is
desireable, in certain situations, to be able to set the 'name'
parameter of the form element.
diff --git a/html/FormTools/Form b/html/FormTools/Form
index 04a6669..05c24ef 100644
--- a/html/FormTools/Form
+++ b/html/FormTools/Form
@@ -7,6 +7,7 @@ $ShowBar => 1
$validation => 0
$forbid_persisting => {}
$form_id => undef
+$form_name => undef
$self_service => 0
</%args>
<%init>
@@ -88,7 +89,13 @@ $next_for_validation ||= $m->caller(1)->path;
<& /Elements/ListActions, actions => \@results &>
-<form method="POST" action="<% $validation ? $next_for_validation : $next %>" enctype="multipart/form-data"<% defined $form_id ? ' id="'.$form_id.'"' : '' |n %>>
+<form
+ method="POST"
+ action="<% $validation ? $next_for_validation : $next %>"
+ enctype="multipart/form-data"
+ <% defined $form_id ? ' id="'.$form_id.'"' : '' |n %>
+ <% defined $form_name ? ' name="'.$form_name.'"' : '' |n %>
+>
% if ($validation) {
<input type="hidden" name="_form_tools_next" value="<%$next%>" />
% }
commit 161e5345f20b35029b666b4d4b7de057203d7792
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed May 28 12:38:25 2014 -0400
Ensure that any form name or id is escaped before being output
diff --git a/html/FormTools/Form b/html/FormTools/Form
index 05c24ef..c70372a 100644
--- a/html/FormTools/Form
+++ b/html/FormTools/Form
@@ -14,6 +14,11 @@ $self_service => 0
use RT::Extension::FormTools;
my $content = $m->content;
+$form_id = $m->interp->apply_escapes( $form_id, 'h')
+ if defined $form_id;
+$form_name = $m->interp->apply_escapes( $form_name, 'h')
+ if defined $form_name;
+
my $header_component = $self_service ? '/SelfService/Elements/Header/' : '/Elements/Header';
my %cfs = map { $_ => 1} @{ $m->notes('cfs_on_page') || [] };
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list