|
From: | Ángel González |
Subject: | Re: [Bug-wget] Bug in processing url query arguments that have '/' |
Date: | Tue, 09 Aug 2011 00:48:13 +0200 |
User-agent: | Thunderbird |
Peng Yu wrote:
Hi, The following line is in utils.c. # in acceptable (const char *s) while (l&& s[l] != '/') --l; if (s[l] == '/') s += (l + 1); It essentially gets a substring after the last '/'. However, when a query has '/', this is problematic. For example, the above code snip will extract '/xxy' instead of 'somescript?arg1=/xxy'. I think that the above code should add the test of the position of '?'. If there is a '?', it should look for the last '/' before '?'. Is it the case? http://xxx.org/somescript?arg1=/xxy
Maybe not. Consider a url like: http://www.example.net/download.php?file=releases/wget.exe In that case using as filename wget.exe makes more sense than address@hidden Whereas there are other cases where the basename is preferible. Probably all examples of a url with a slash in the query string are a bit contrived.
[Prev in Thread] | Current Thread | [Next in Thread] |