[Rt-commit] rt branch, 5.0/fix-quoted-date-input-id, created. rt-5.0.0-22-g4e136cdf1c
? sunnavy
sunnavy at bestpractical.com
Mon Sep 28 14:58:08 EDT 2020
The branch, 5.0/fix-quoted-date-input-id has been created
at 4e136cdf1c87573877875815048e272fbca84f3f (commit)
- Log -----------------------------------------------------------------
commit 4e136cdf1c87573877875815048e272fbca84f3f
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Sep 18 03:52:54 2020 +0800
Fix the wrongly quoted date input id
The generated HTML was like id=""Starts_Date"", as quotes were
escaped there. We want to escape $id, but not the quotes.
Note that we can't unconditionally write id="<% $id %>" because $id
could be empty while HTML id attribute must contain some value if
exists. See also 91d64c4c6d.
diff --git a/share/html/Elements/SelectDate b/share/html/Elements/SelectDate
index 0686f9ca9e..d9f64c0ce8 100644
--- a/share/html/Elements/SelectDate
+++ b/share/html/Elements/SelectDate
@@ -46,7 +46,11 @@
%#
%# END BPS TAGGED BLOCK }}}
% $m->callback( %ARGS, Name => $Name, CallbackName => 'BeforeDateInput', Object => $Object, ARGSRef => $ARGSRef, ShowTimeRef => \$ShowTime, );
-<input type="text" class="datepicker<% $ShowTime ? ' withtime' : '' %> form-control" <% $id ? qq[id="$id" ] : '' %> name="<% $Name %>" value="<% $Default %>" size="<% $Size %>" autocomplete="off" />
+<input type="text" class="datepicker<% $ShowTime ? ' withtime' : '' %> form-control"
+% if ( $id ) {
+ id="<% $id %>"
+% }
+ name="<% $Name %>" value="<% $Default %>" size="<% $Size %>" autocomplete="off" />
% $m->callback( %ARGS, Name => $Name, CallbackName => 'AfterDateInput', Object => $Object, ARGSRef => $ARGSRef, );
<%init>
unless ((defined $Default) or ($current <= 0)) {
-----------------------------------------------------------------------
More information about the rt-commit
mailing list