forked from Alex/Pterodactyl-Panel
Decode the filename when rendering it to the screen; closes #2101
This commit is contained in:
parent
050fe307f0
commit
b30d7429f3
@ -25,10 +25,10 @@ export default ({ withinFileEditor, isNewFile }: Props) => {
|
||||
.filter(directory => !!directory)
|
||||
.map((directory, index, dirs) => {
|
||||
if (!withinFileEditor && index === dirs.length - 1) {
|
||||
return { name: directory };
|
||||
return { name: decodeURIComponent(directory) };
|
||||
}
|
||||
|
||||
return { name: directory, path: `/${dirs.slice(0, index + 1).join('/')}` };
|
||||
return { name: decodeURIComponent(directory), path: `/${dirs.slice(0, index + 1).join('/')}` };
|
||||
});
|
||||
|
||||
return (
|
||||
@ -57,7 +57,7 @@ export default ({ withinFileEditor, isNewFile }: Props) => {
|
||||
}
|
||||
{file &&
|
||||
<React.Fragment>
|
||||
<span className={'px-1 text-neutral-300'}>{file}</span>
|
||||
<span className={'px-1 text-neutral-300'}>{decodeURIComponent(file)}</span>
|
||||
</React.Fragment>
|
||||
}
|
||||
</div>
|
||||
|
@ -70,7 +70,12 @@ export default () => {
|
||||
/>
|
||||
<p className={'text-xs mt-2 text-neutral-400'}>
|
||||
<span className={'text-neutral-200'}>This directory will be created as</span>
|
||||
/home/container/<span className={'text-cyan-200'}>{join(directory, values.directoryName).replace(/^(\.\.\/|\/)+/, '')}</span>
|
||||
/home/container/
|
||||
<span className={'text-cyan-200'}>
|
||||
{decodeURIComponent(
|
||||
join(directory, values.directoryName).replace(/^(\.\.\/|\/)+/, ''),
|
||||
)}
|
||||
</span>
|
||||
</p>
|
||||
<div className={'flex justify-end'}>
|
||||
<button className={'btn btn-sm btn-primary mt-8'}>
|
||||
|
@ -48,7 +48,7 @@ const files: ServerFileStore = {
|
||||
}),
|
||||
|
||||
setDirectory: action((state, payload) => {
|
||||
state.directory = cleanDirectoryPath(payload)
|
||||
state.directory = cleanDirectoryPath(payload);
|
||||
}),
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user