Skip to content

Commit d8ae7cd

Browse files
fixes #7865
1 parent eb820ba commit d8ae7cd

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

admin/src/pages/PadPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export const PadPage = () => {
418418
</button>
419419
<button
420420
className="pm-btn pm-btn-primary pm-btn--sm"
421-
onClick={() => window.open(`../../p/${pad.padName}`, '_blank')}
421+
onClick={() => window.open(`../../p/${encodeURIComponent(pad.padName)}`, '_blank')}
422422
>
423423
<Eye size={13}/> <Trans i18nKey="admin_pads.open"/>
424424
</button>

src/static/js/pad_userlist.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ const paduserlist = (() => {
557557
if (localStorage.getItem('recentPads') != null) {
558558
const recentPadsList = JSON.parse(localStorage.getItem('recentPads'));
559559
const pathSegments = window.location.pathname.split('/');
560-
const padName = pathSegments[pathSegments.length - 1];
560+
const padName = decodeURIComponent(pathSegments[pathSegments.length - 1]);
561561
const existingPad = recentPadsList.find((pad) => pad.name === padName);
562562
if (existingPad) {
563563
existingPad.members = online;

src/static/skins/colibris/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ window.customStart = () => {
7070
li.style.cursor = 'pointer';
7171

7272
li.className = 'recent-pad';
73-
const padPath = `${window.location.href}p/${pad.name}`;
73+
const decodedName = decodeURIComponent(pad.name);
74+
const padPath = `${window.location.href}p/${encodeURIComponent(decodedName)}`;
7475
const link = document.createElement('a');
7576
link.style.textDecoration = 'none';
7677

7778
link.href = padPath;
78-
link.innerText = pad.name;
79+
link.innerText = decodedName;
7980
li.appendChild(link);
8081

8182

src/static/skins/colibris/pad.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ window.customStart = () => {
88
$('.buttonicon').on('mouseup', function () { $(this).parent().removeClass('pressed'); });
99

1010
const pathSegments = window.location.pathname.split('/');
11-
const padName = pathSegments[pathSegments.length - 1];
11+
const padName = decodeURIComponent(pathSegments[pathSegments.length - 1]);
1212
const recentPads = localStorage.getItem('recentPads');
1313
if (recentPads == null) {
1414
localStorage.setItem('recentPads', JSON.stringify([]));

var/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ minified*
33
installed_plugins.json
44
dirty.db
55
rusty.db
6+
update-state.json

0 commit comments

Comments
 (0)