Bug: trailing spaces in some argument values

Bug reports and enhancement requests
Post Reply
vipiish
Posts: 4
Joined: Mon Oct 07, 2013 12:51 am

Bug: trailing spaces in some argument values

Post 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.
Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Bug: trailing spaces in some argument values

Post by Giorgio Maone »

Investigating, thanks.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
vipiish
Posts: 4
Joined: Mon Oct 07, 2013 12:51 am

Re: Bug: trailing spaces in some argument values

Post 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).
Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0
vipiish
Posts: 4
Joined: Mon Oct 07, 2013 12:51 am

Re: Bug: trailing spaces in some argument values

Post 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?
Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0
User avatar
Giorgio Maone
Site Admin
Posts: 9454
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Bug: trailing spaces in some argument values

Post by Giorgio Maone »

Please check latest development build 1.5.5.95rc1, thank you.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
Jan
Posts: 1
Joined: Mon Jul 20, 2015 11:04 pm

Re: Bug: trailing spaces in some argument values

Post by Jan »

This bug is still around in 1.5.6.12.1-signed. Please fix
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:39.0) Gecko/20100101 Firefox/39.0
Post Reply