From d8ae7cda37d1be11f8d730d52328e0f018cd8970 Mon Sep 17 00:00:00 2001 From: abhijeetgorhe26 Date: Sat, 30 May 2026 02:27:13 +0530 Subject: [PATCH 1/5] fixes #7865 --- admin/src/pages/PadPage.tsx | 2 +- src/static/js/pad_userlist.ts | 2 +- src/static/skins/colibris/index.js | 5 +++-- src/static/skins/colibris/pad.js | 2 +- var/.gitignore | 1 + 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/admin/src/pages/PadPage.tsx b/admin/src/pages/PadPage.tsx index c216ffab79f..039c10b578d 100644 --- a/admin/src/pages/PadPage.tsx +++ b/admin/src/pages/PadPage.tsx @@ -418,7 +418,7 @@ export const PadPage = () => { diff --git a/src/static/js/pad_userlist.ts b/src/static/js/pad_userlist.ts index d3ee825276c..7366348a1f0 100644 --- a/src/static/js/pad_userlist.ts +++ b/src/static/js/pad_userlist.ts @@ -557,7 +557,7 @@ const paduserlist = (() => { if (localStorage.getItem('recentPads') != null) { const recentPadsList = JSON.parse(localStorage.getItem('recentPads')); const pathSegments = window.location.pathname.split('/'); - const padName = pathSegments[pathSegments.length - 1]; + const padName = decodeURIComponent(pathSegments[pathSegments.length - 1]); const existingPad = recentPadsList.find((pad) => pad.name === padName); if (existingPad) { existingPad.members = online; diff --git a/src/static/skins/colibris/index.js b/src/static/skins/colibris/index.js index f36edf84180..7936cb278ad 100644 --- a/src/static/skins/colibris/index.js +++ b/src/static/skins/colibris/index.js @@ -70,12 +70,13 @@ window.customStart = () => { li.style.cursor = 'pointer'; li.className = 'recent-pad'; - const padPath = `${window.location.href}p/${pad.name}`; + const decodedName = decodeURIComponent(pad.name); + const padPath = `${window.location.href}p/${encodeURIComponent(decodedName)}`; const link = document.createElement('a'); link.style.textDecoration = 'none'; link.href = padPath; - link.innerText = pad.name; + link.innerText = decodedName; li.appendChild(link); diff --git a/src/static/skins/colibris/pad.js b/src/static/skins/colibris/pad.js index 1e7a85b3faa..ce509a8892b 100644 --- a/src/static/skins/colibris/pad.js +++ b/src/static/skins/colibris/pad.js @@ -8,7 +8,7 @@ window.customStart = () => { $('.buttonicon').on('mouseup', function () { $(this).parent().removeClass('pressed'); }); const pathSegments = window.location.pathname.split('/'); - const padName = pathSegments[pathSegments.length - 1]; + const padName = decodeURIComponent(pathSegments[pathSegments.length - 1]); const recentPads = localStorage.getItem('recentPads'); if (recentPads == null) { localStorage.setItem('recentPads', JSON.stringify([])); diff --git a/var/.gitignore b/var/.gitignore index d75cb9e42b2..578a814a59a 100644 --- a/var/.gitignore +++ b/var/.gitignore @@ -3,3 +3,4 @@ minified* installed_plugins.json dirty.db rusty.db +update-state.json \ No newline at end of file From 9a35fab26eea3a76b61d8d4e13288ab1710e7567 Mon Sep 17 00:00:00 2001 From: abhijeetgorhe26 <121374073+abhijeetgorhe26@users.noreply.github.com> Date: Sat, 30 May 2026 02:38:12 +0530 Subject: [PATCH 2/5] fixes #7865 From 70cd279f10097c31f42e8ae105705b2468cd8f87 Mon Sep 17 00:00:00 2001 From: abhijeetgorhe26 Date: Sat, 30 May 2026 18:02:38 +0530 Subject: [PATCH 3/5] fixes #7865 --- src/static/skins/colibris/index.js | 5 ++- .../frontend-new/specs/recent_pads.spec.ts | 32 +++++++++++++++++++ var/log/update.log | 3 ++ 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 src/tests/frontend-new/specs/recent_pads.spec.ts create mode 100644 var/log/update.log diff --git a/src/static/skins/colibris/index.js b/src/static/skins/colibris/index.js index 7936cb278ad..3da389330bc 100644 --- a/src/static/skins/colibris/index.js +++ b/src/static/skins/colibris/index.js @@ -70,13 +70,12 @@ window.customStart = () => { li.style.cursor = 'pointer'; li.className = 'recent-pad'; - const decodedName = decodeURIComponent(pad.name); - const padPath = `${window.location.href}p/${encodeURIComponent(decodedName)}`; + const padPath = `${window.location.href}p/${encodeURIComponent(pad.name)}`; const link = document.createElement('a'); link.style.textDecoration = 'none'; link.href = padPath; - link.innerText = decodedName; + link.innerText = pad.name; li.appendChild(link); diff --git a/src/tests/frontend-new/specs/recent_pads.spec.ts b/src/tests/frontend-new/specs/recent_pads.spec.ts new file mode 100644 index 00000000000..a73ef83aa76 --- /dev/null +++ b/src/tests/frontend-new/specs/recent_pads.spec.ts @@ -0,0 +1,32 @@ +import { test, expect } from '@playwright/test'; + +test.describe('Recent Pads', () => { + test('should display correctly encoded URLs for recent pads', async ({ page }) => { + const padName = 'test pad with spaces & / chars'; + const recentPads = [ + { + name: padName, + timestamp: new Date().toISOString(), + members: 1, + }, + ]; + + // Add recent pad to localStorage before navigating + await page.addInitScript((data) => { + window.localStorage.setItem('recentPads', data); + }, JSON.stringify(recentPads)); + + await page.goto('localhost:9001/'); + + const recentPad = page.locator('.recent-pad').first(); + await expect(recentPad).toBeVisible(); + + const link = recentPad.locator('a'); + await expect(link).toHaveText(padName); + + // Assert the href has the properly encoded URL + const expectedEncodedName = encodeURIComponent(padName); + const expectedHrefRegex = new RegExp(`p/${expectedEncodedName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}$`); + await expect(link).toHaveAttribute('href', expectedHrefRegex); + }); +}); diff --git a/var/log/update.log b/var/log/update.log new file mode 100644 index 00000000000..6832f83eeb5 --- /dev/null +++ b/var/log/update.log @@ -0,0 +1,3 @@ +[2026-05-30T12:28:01.272Z] CANCEL by admin during status=scheduled +[2026-05-30T12:28:01.289Z] ACKNOWLEDGE rollback-failed -> idle +[2026-05-30T12:28:01.303Z] ACKNOWLEDGE preflight-failed -> idle From e2acf22b6e8d82fb18e43bce4f2ea25a6d9837b0 Mon Sep 17 00:00:00 2001 From: abhijeetgorhe26 <121374073+abhijeetgorhe26@users.noreply.github.com> Date: Sat, 30 May 2026 18:10:24 +0530 Subject: [PATCH 4/5] fixes #7865 --- var/.gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/var/.gitignore b/var/.gitignore index 578a814a59a..d75cb9e42b2 100644 --- a/var/.gitignore +++ b/var/.gitignore @@ -3,4 +3,3 @@ minified* installed_plugins.json dirty.db rusty.db -update-state.json \ No newline at end of file From 78de447f078cbec3b782061465a177b562956630 Mon Sep 17 00:00:00 2001 From: abhijeetgorhe26 <121374073+abhijeetgorhe26@users.noreply.github.com> Date: Sat, 30 May 2026 20:38:26 +0530 Subject: [PATCH 5/5] Fixes #7865 --- var/log/update.log | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 var/log/update.log diff --git a/var/log/update.log b/var/log/update.log deleted file mode 100644 index 6832f83eeb5..00000000000 --- a/var/log/update.log +++ /dev/null @@ -1,3 +0,0 @@ -[2026-05-30T12:28:01.272Z] CANCEL by admin during status=scheduled -[2026-05-30T12:28:01.289Z] ACKNOWLEDGE rollback-failed -> idle -[2026-05-30T12:28:01.303Z] ACKNOWLEDGE preflight-failed -> idle