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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitted by:  Graham J Lee <iamleeg>
Submitted on:  Fri 01 Dec 2006 12:06:43 PM UTC  
 
Category: NoneSeverity: 2 - Minor
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Closed

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>
Project 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>
Project 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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 17 Jan 2007 09:42:26 AM UTCCaSOpen/ClosedOpen=>Closed
    Mon 18 Dec 2006 03:17:48 PM UTCCaSSeverity3 - Normal=>2 - Minor
    Tue 05 Dec 2006 01:50:47 PM UTCCaSAttached File#11419=>Removed
    Fri 01 Dec 2006 12:06:43 PM UTCiamleegAttached File-=>Added nsurl-nilreturntest-patch, #11419

    Back to the top


    Powered by Savane 3.1-cleanup1