[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.0rc4-32-gbb05783
Alex Vandiver
alexmv at bestpractical.com
Mon Jan 31 17:47:39 EST 2011
The branch, 4.0-trunk has been updated
via bb0578369aed4fb9b797e05f6d323215cbc81389 (commit)
from 13340221d6be810a758822f5c95d022fc3e64c58 (commit)
Summary of changes:
share/html/NoAuth/js/util.js | 8 ++++++--
share/html/Ticket/Elements/UpdateCc | 16 ++++++----------
2 files changed, 12 insertions(+), 12 deletions(-)
- Log -----------------------------------------------------------------
commit bb0578369aed4fb9b797e05f6d323215cbc81389
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Jan 31 17:26:18 2011 -0500
Instead of 1334022, escape the CSS selector instead
diff --git a/share/html/NoAuth/js/util.js b/share/html/NoAuth/js/util.js
index ef29240..58855a6 100644
--- a/share/html/NoAuth/js/util.js
+++ b/share/html/NoAuth/js/util.js
@@ -186,8 +186,8 @@ function checkAllObjects()
}
function checkboxToInput(target,checkbox,val){
- var tar = jQuery('#' + target);
- var box = jQuery('#' + checkbox);
+ var tar = jQuery('#' + escapeCssSelector(target));
+ var box = jQuery('#' + escapeCssSelector(checkbox));
if(box.attr('checked')){
if (tar.val()==''){
tar.val(val);
@@ -341,3 +341,7 @@ function addprincipal_onchange(ev, ui) {
}
}
+
+function escapeCssSelector(str) {
+ return str.replace(/([^A-Za-z0-9_-])/g,'\\$1');
+}
diff --git a/share/html/Ticket/Elements/UpdateCc b/share/html/Ticket/Elements/UpdateCc
index e8363c5..c1518cd 100644
--- a/share/html/Ticket/Elements/UpdateCc
+++ b/share/html/Ticket/Elements/UpdateCc
@@ -55,16 +55,14 @@
<i class="label">(<&|/l&>check to add</&>)</i>
%}
%foreach my $addr ( @one_time_Ccs ) {
-% my $cleanid = $addr;
-% $cleanid =~ s/\W//g;
<input
- id="UpdateCc-<%$cleanid%>"
- name="UpdateCc-<%$cleanid%>"
+ id="UpdateCc-<%$addr%>"
+ name="UpdateCc-<%$addr%>"
class="onetime onetimecc"
type="checkbox"
% my $clean_addr = $txn_addresses{$addr}->format;
% $clean_addr =~ s/'/\\'/g;
- onClick="checkboxToInput('UpdateCc', 'UpdateCc-<%$cleanid%>','<%$clean_addr%>' );"
+ onClick="checkboxToInput('UpdateCc', 'UpdateCc-<%$addr%>','<%$clean_addr%>' );"
<% $ARGS{'UpdateCc-'.$addr} ? 'checked="checked"' : ''%> > <& /Elements/ShowUser, Address => $txn_addresses{$addr}&>
%}
</td></tr>
@@ -74,15 +72,13 @@
%}
%foreach my $addr ( @one_time_Ccs ) {
<input
-% my $cleanid = $addr;
-% $cleanid =~ s/\W//g;
- id="UpdateBcc-<%$cleanid%>"
- name="UpdateBcc-<%$cleanid%>"
+ id="UpdateBcc-<%$addr%>"
+ name="UpdateBcc-<%$addr%>"
class="onetime onetimebcc"
type="checkbox"
% my $clean_addr = $txn_addresses{$addr}->format;
% $clean_addr =~ s/'/\\'/g;
- onClick="checkboxToInput('UpdateBcc', 'UpdateBcc-<%$cleanid%>','<%$clean_addr%>' );"
+ onClick="checkboxToInput('UpdateBcc', 'UpdateBcc-<%$addr%>','<%$clean_addr%>' );"
<% $ARGS{'UpdateBcc-'.$addr} ? 'checked="checked"' : ''%>>
<& /Elements/ShowUser, Address => $txn_addresses{$addr}&>
%}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list