From 337588e594c9d00c4e7b68b19cc5c0f5182bc7a3 Mon Sep 17 00:00:00 2001 From: "Alexander V. Wolf" Date: Sat, 28 Sep 2024 21:16:12 +0700 Subject: [PATCH] Fix code scanning alert no. 20: Unsafe jQuery plugin Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- plugins/RemoteControl/webroot/js/jquery-ui.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/RemoteControl/webroot/js/jquery-ui.js b/plugins/RemoteControl/webroot/js/jquery-ui.js index 1a613bf2f94b3..db2fe5a137b4e 100644 --- a/plugins/RemoteControl/webroot/js/jquery-ui.js +++ b/plugins/RemoteControl/webroot/js/jquery-ui.js @@ -907,9 +907,7 @@ $.fn.position = function( options ) { var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, // Make sure string options are treated as CSS selectors - target = typeof options.of === "string" ? - $( document ).find( options.of ) : - $( options.of ), + target = $( document ).find( options.of ), within = $.position.getWithinInfo( options.within ), scrollInfo = $.position.getScrollInfo( within ),