Bugzilla – Bug 536
Files with ` or " in name cannot be transcoded
Last modified: 2011-03-16 04:39:20 UTC
Files with ` (decimal 96 in ISO Latin 1) or " (decimal 34) in name cannot be transcoded, because the ` is the delimiter for the shell command and the " encloses the filename in $command. The attached patch escapes these two characters in $filepath. Then it works. :-)
Created attachment 123 [details] Proposed patch
*** Bug 228 has been marked as a duplicate of this bug. ***
I imagine that there are other characters that also need to be escaped for the shell. Seems like it could be a single regexp.
if this single regexp was put in pathFromFileURL, we might be abl eto use this to fix the other problems caused by ' and ", (likely * too),etc. Such as bug42 and bug454.
This should be fixed in latest nightly, I believe. Please confirm.
I see in the code comment that it is meant to escape $ and *, but the code only seems to escape ' " and $ # escape $ and * in file names and URLs. $filepath =~ s/([\$\"\`])/\\$1/g; $fullpath =~ s/([\$\"\`])/\\$1/g; seems it should be: # escape special characters in file names and URLs. $filepath =~ s/([\$\"\`\*])/\\$1/g; $fullpath =~ s/([\$\"\`\*])/\\$1/g;
That's right. The path name is in quotes, so the * isn't expanded by the shell. This isn't true for backtick, dollar and double-quote. Is it failing for you?
no, I dont use those chars in any filename. I was just curious if something was missed.
do we have a confirmation that this now works?
There are 536 bugs in the database with targets of '---' that were fixed prior to new year 2006. I am setting them to targets of 6.2.1 to keep them from showing up in my queries.