From a77fcc47a54995a6ab7f7e5c4e65550812d0b409 Mon Sep 17 00:00:00 2001 From: Tom Konda <tom.konda.dev@gmail.com> Date: Fri, 7 Mar 2025 19:28:19 +0900 Subject: [PATCH] Replace regexp.test() with String.prototype.includes() --- core/modules/toolbar/js/escapeAdmin.js | 2 +- core/modules/views/js/ajax_view.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/toolbar/js/escapeAdmin.js b/core/modules/toolbar/js/escapeAdmin.js index 2d76991e9dc5..f7956befe233 100644 --- a/core/modules/toolbar/js/escapeAdmin.js +++ b/core/modules/toolbar/js/escapeAdmin.js @@ -14,7 +14,7 @@ // loaded within an existing "workflow". if ( !pathInfo.currentPathIsAdmin && - !/destination=/.test(windowLocation.search) + !windowLocation.search.includes('destination=') ) { sessionStorage.setItem('escapeAdminPath', windowLocation); } diff --git a/core/modules/views/js/ajax_view.js b/core/modules/views/js/ajax_view.js index 873ad6c7e69f..bf3ac26fa6c9 100644 --- a/core/modules/views/js/ajax_view.js +++ b/core/modules/views/js/ajax_view.js @@ -83,7 +83,7 @@ if (queryString !== '') { // If there is a '?' in ajaxPath, clean URL are on and & should be // used to add parameters. - queryString = (/\?/.test(ajaxPath) ? '&' : '?') + queryString; + queryString = (ajaxPath.includes('?') ? '&' : '?') + queryString; } } -- GitLab