From 1baefea4108772fe490052d2fb14e7d4bd6352cc Mon Sep 17 00:00:00 2001 From: tomasz1986 Date: Sun, 8 Sep 2024 12:42:32 +0200 Subject: [PATCH] gui: Actually filter scope ID out of IPv6 address when using Remote GUI (ref #8084) (#9688) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gui: Actually filter scope ID out of IPv6 address when using Remote GUI (ref #8084) The current code does not work, because it uses a string in the replace() method instead of regex. Thus, change it to a proper regex. Signed-off-by: Tomasz WilczyƄski --- gui/default/syncthing/core/syncthingController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 51f08d050..57309cee2 100644 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -1447,7 +1447,7 @@ angular.module('syncthing.core') // Assume hasRemoteGUIAddress is true or we would not be here var conn = $scope.connections[deviceCfg.deviceID]; // Use regex to filter out scope ID from IPv6 addresses. - return 'http://' + replaceAddressPort(conn.address, deviceCfg.remoteGUIPort).replace('%.*?\]:', ']:'); + return 'http://' + replaceAddressPort(conn.address, deviceCfg.remoteGUIPort).replace(/%.*?\]:/, ']:'); }; function replaceAddressPort(address, newPort) {