Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weird escaping in Recent Files menu description area when a file path has square brackets #3620

Closed
Lx opened this issue Oct 29, 2014 · 2 comments · Fixed by #5798
Closed

Comments

@Lx
Copy link
Contributor

Lx commented Oct 29, 2014

Menu > Recent Files shows the full path of the selected item in the description area at the bottom of the menu.

For files with square brackets in the path, the brackets in the full path are URL-escaped. Please see the attached screen shot. The correct path is .../Desktop/Folder [with square brackets]/File.txt.

screenshot from 2014-10-29 11 31 52

@Vahan86
Copy link

Vahan86 commented Sep 29, 2016

Tested in Cinnamon 3.0.7. The issue is still there.

The issue is not only about [] symbols, it's relevant to {}, <>, "" symbols as well.

untitled

@Odyseus
Copy link
Contributor

Odyseus commented Sep 29, 2016

Hello, everybody.

I'm also seeing this on Cinnamon 3.0.7 (stable and nightly). It seems that this is the product of only un-escaping spaces on the following two lines of the applet code:

Line 1784

this.selectedAppDescription.set_text(button.place.id.slice(16).replace(/%20/g, ' '));

Line 1851

this.selectedAppDescription.set_text(button.file.uri.slice(7).replace(/%20/g, ' '));

To fix it, and as a test, I tried to use decodeURIComponent like this:

this.selectedAppDescription.set_text(decodeURIComponent(button.place.id.slice(16)));
this.selectedAppDescription.set_text(decodeURIComponent(button.file.uri.slice(7)));

With the previous edit, all paths were shown correctly inside the info box. I repeat, this was just a test. I don't know if it is safe to use decodeURIComponent in that place. Maybe not all characters should be un-escaped inside a label? It would be great to have the opinion of one of the developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants