[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #18431] +[NSURL URLWithString:relativeToURL:] creates a URL with in
From: |
Graham J Lee |
Subject: |
[bug #18431] +[NSURL URLWithString:relativeToURL:] creates a URL with invalid input |
Date: |
Fri, 01 Dec 2006 12:06:45 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0 |
URL:
<http://savannah.gnu.org/bugs/?18431>
Summary: +[NSURL URLWithString:relativeToURL:] creates a URL
with invalid input
Project: GNUstep
Submitted by: iamleeg
Submitted on: Friday 12/01/2006 at 12:06
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
According to the GNUstep documentation:
If the string cannot be parsed the method returns nil.
According to the Cocoa documentation:
The NSURL class will fail to create a new NSURL object if the path being
passed is not well-formed—the path must comply with RFC 2396. Examples of
cases that will not succeed are strings containing space characters and
high-bit characters. Should creating an NSURL object fail, the creation
methods will return nil, which you must be prepared to handle.
However, the test:
NSURL *url = [NSURL URLWithString:@"this isn't a URL"];
NSLog (@"Got URL: %@", url);
2006-12-01 12:02:26.066 basic[6402] URL: this isn't a URL
shows that non-conforming URLs don't cause a nil return.
I've codified this as a test on NSURL, with the patch to the testsuite
attached.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Friday 12/01/2006 at 12:06 Name: nsurl-nilreturntest-patch Size: 544B
By: iamleeg
Testsuite patch to verify (partial) fix of this bug
<http://savannah.gnu.org/bugs/download.php?file_id=11419>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?18431>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [bug #18431] +[NSURL URLWithString:relativeToURL:] creates a URL with invalid input,
Graham J Lee <=