Skip to content

Commit

Permalink
Merge branch '5.0/one-time-cc-special-chars' into 5.0-trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrandtbuffalo committed Jan 23, 2024
2 parents f9ddbad + 57976db commit 6f3cb67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion share/html/Ticket/Update.html
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@
var unchecked = 0;
jQuery('input:checkbox[name^=' + prefix + ']').each( function() {
var name = jQuery(this).attr('name');
name = name.replace(prefix + '-', '');
name = escapeRegExp(name.replace(prefix + '-', ''));

var filter_function = function(n,i) {
return n.match(new RegExp('^\\s*' + name + '\\s*$', 'i')) || n.match(new RegExp('<\\s*' + name + '\\s*>', 'i'));
};
Expand Down
4 changes: 4 additions & 0 deletions share/static/js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,10 @@ function escapeCssSelector(str) {
return str.replace(/([^A-Za-z0-9_-])/g,'\\$1');
}

function escapeRegExp(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string
}

function createCookie(name,value,days) {
var path = RT.Config.WebPath ? RT.Config.WebPath : "/";

Expand Down

0 comments on commit 6f3cb67

Please sign in to comment.