bugGNUstep - Bugs: bug #18431, +[NSURL...

Group
 
 

bug #18431: +[NSURL URLWithString:relativeToURL:] creates a URL with invalid input

Submitter:  Graham J Lee <iamleeg>
Submitted:  Fri 01 Dec 2006 12:06:43 PM UTC
   
 
Category:  None Severity:  2 - Minor
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 17 Jan 2007 09:42:26 AM UTC, comment #2: 

I think this is working as expected now (returning nil for the same cases as MacOS-X)

Richard Frith-Macdonald <CaS>
Group Member
Mon 18 Dec 2006 03:17:48 PM UTC, comment #1: 

At least partially fixed ... now checks that a scheme is provided.

Richard Frith-Macdonald <CaS>
Group Member
Fri 01 Dec 2006 12:06:43 PM UTC, original submission:  

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.

Graham J Lee <iamleeg>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by iamleeg (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-01-17 CaS Open/ClosedOpen Closed
    2006-12-18 CaS Severity3 - Normal 2 - Minor
    2006-12-05 CaS Attached File#11419 Removed
    2006-12-01 iamleeg Attached File- Added nsurl-nilreturntest-patch, #11419

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code