Page 1 of 1

Problem with filename while downloading directory

PostPosted: Mon Dec 26, 2011 5:31 pm
by bile
It appears that double quotes (at least) cause problems when Subsonic is creating a filename for download.

In my case it was: Part_X_-_"Something" and the filename is just Part_X_-_ without even a .zip. I also notice that when you hover over the directory the same truncating occurs.

Re: Problem with filename while downloading directory

PostPosted: Mon Jan 02, 2012 12:39 am
by ytechie
That is because what is between a pair of quotes is what the value is. Hmmm.... how do I say this?
When the backend is referencing the file, it says "the file name is what is between the pair of quotes."
If the filename contains a quote, then the backend says "hey, what is between the quotes must be the full file name."

I don't think I explained it very well, so you may want to look up "SQL Injections" to get a better feel for why this is happening.

Re: Problem with filename while downloading directory

PostPosted: Tue Jan 10, 2012 8:51 pm
by bile
It's a bug either way. I've just noticed that attempting to update coverart also fails for directories with double quotes. Something isn't being properly escaped.

Re: Problem with filename while downloading directory

PostPosted: Fri Feb 17, 2012 3:04 am
by bile
Another more serious version of this issue.

Error: unterminated string literal
Source File: http://192.168.0.4:4040/main.view?pathU ... 65726f7322
Line: 1, Column: 20
Source Code:
top.playlist.onPlay('/media/music/D/David_Bowie/Album/1977B=\

When trying to play something from "Heros". Nothing gets queued due to the JS error.