mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Slightly stricter parsing
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/branches/stable@24376 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0c3bc33da5
commit
9b8de2e5a8
1 changed files with 24 additions and 0 deletions
|
@ -627,6 +627,10 @@ static unsigned urlAlign;
|
|||
- (id) initWithString: (NSString*)aUrlString
|
||||
relativeToURL: (NSURL*)aBaseUrl
|
||||
{
|
||||
/* RFC 2396 'reserved' characters ...
|
||||
*/
|
||||
static const char *reserved = ";/?:@&=+$,";
|
||||
|
||||
if (aUrlString == nil)
|
||||
{
|
||||
[NSException raise: NSInvalidArgumentException
|
||||
|
@ -879,6 +883,11 @@ static unsigned urlAlign;
|
|||
if (buf->fragment == 0 && base != 0)
|
||||
{
|
||||
buf->fragment = base->fragment;
|
||||
if (legal(buf->fragment, reserved) == NO)
|
||||
{
|
||||
[NSException raise: NSGenericException format:
|
||||
@"illegal character in fragment part"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -899,6 +908,11 @@ static unsigned urlAlign;
|
|||
if (buf->query == 0 && base != 0)
|
||||
{
|
||||
buf->query = base->query;
|
||||
if (legal(buf->query, reserved) == NO)
|
||||
{
|
||||
[NSException raise: NSGenericException format:
|
||||
@"illegal character in query part"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -919,6 +933,11 @@ static unsigned urlAlign;
|
|||
if (buf->parameters == 0 && base != 0)
|
||||
{
|
||||
buf->parameters = base->parameters;
|
||||
if (legal(buf->parameters, reserved) == NO)
|
||||
{
|
||||
[NSException raise: NSGenericException format:
|
||||
@"illegal character in parameters part"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -944,6 +963,11 @@ static unsigned urlAlign;
|
|||
* Store the path.
|
||||
*/
|
||||
buf->path = start;
|
||||
if (legal(buf->path, reserved) == NO)
|
||||
{
|
||||
[NSException raise: NSGenericException format:
|
||||
@"illegal character in path part"];
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue