From 6f282c2cf246c274580916fc326b148c8e46af2c Mon Sep 17 00:00:00 2001 From: npt-1707 Date: Mon, 30 Mar 2026 01:37:47 +0800 Subject: [PATCH] code/jeeplatform-admin/src/main/webapp/static/js/bootstrap/bootstrap.js: Fix XSS --- .../main/webapp/static/js/bootstrap/bootstrap.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/code/jeeplatform-admin/src/main/webapp/static/js/bootstrap/bootstrap.js b/code/jeeplatform-admin/src/main/webapp/static/js/bootstrap/bootstrap.js index 8ae571b..bc3ab24 100644 --- a/code/jeeplatform-admin/src/main/webapp/static/js/bootstrap/bootstrap.js +++ b/code/jeeplatform-admin/src/main/webapp/static/js/bootstrap/bootstrap.js @@ -84,7 +84,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 } - var $parent = $(selector) + selector = selector === '#' ? [] : selector + var $parent = $(document).find(selector) if (e) e.preventDefault() @@ -434,8 +435,14 @@ if (typeof jQuery === 'undefined') { throw new Error('Bootstrap\'s JavaScript re // ================= $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { - var $this = $(this), href - var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + var $this = $(this) + var href = $this.attr('href') + if (href) { + href = href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 + } + + var target = $this.attr('data-target') || href + var $target = $(document).find(target) var options = $.extend({}, $target.data(), $this.data()) var slideIndex = $this.attr('data-slide-to') if (slideIndex) options.interval = false