Page 1 of 1

Bug: trailing spaces in some argument values

Posted: Wed Nov 06, 2013 6:01 pm
by vipiish
This bug applies to URL and REFERER and possibly other values. E.g.:

"http://www.example.com/abc.html "

This is revealed if I pass the arguments to a batch (.bat) file and print out the arguments (ECHO %*). And this causes an error with e.g. aria2c with URLs because it will assume it is indeed part of the URL and convert the space to %20.

This is the argument line I use:

Code: Select all

[--dir=FOLDER] [--out=FNAME] [--referer=REFERER] [--load-cookies=CFILE] [URL]
Hope you can fix this ASAP. Thanks.

Re: Bug: trailing spaces in some argument values

Posted: Wed Nov 06, 2013 8:06 pm
by Giorgio Maone
Investigating, thanks.

Re: Bug: trailing spaces in some argument values

Posted: Wed Nov 06, 2013 8:34 pm
by vipiish
Thanks for the quick response.

I could be wrong, but perhaps I should add, that sometimes, for whatever reason, it DOES seem to pass the proper value(s) without trailing spaces inside the quotes. But this is definitely a consistent error with YouTube links at the very least (and this is only an example - I'm not saying you should go looking for bugs in the code that parses YouTube stuff, because I'm sure I've had the issue with other links as well).

Re: Bug: trailing spaces in some argument values

Posted: Thu Nov 07, 2013 10:04 pm
by vipiish
Took me a while to find the source for the problem, but perhaps this suffices... (at least it worked with aria2c.):

In chrome/flashgot.jar/content/flashgot/DMS.js, replace:

Code: Select all

return (/[;&=]/.test(s) && !/\s/.test(s)) // "=" and ";" are command line separators on win!!!
? s + " " : s; // we add a space to force escaping
With:

Code: Select all

var rstr = /^\w+:\/+/.test(s) ? "# " : " ";
return (/[;&=]/.test(s) && !/\s/.test(s)) // "=" and ";" are command line separators on win!!!
? s + rstr : s; // we add a space to force escaping
But perhaps this introduces other incompatibilities? Has anyone ever seen a download link which relies on a fragment value to be present?

Re: Bug: trailing spaces in some argument values

Posted: Sun Nov 17, 2013 8:44 pm
by Giorgio Maone
Please check latest development build 1.5.5.95rc1, thank you.

Re: Bug: trailing spaces in some argument values

Posted: Mon Jul 20, 2015 11:07 pm
by Jan
This bug is still around in 1.5.6.12.1-signed. Please fix