]> git.saurik.com Git - cydia.git/commitdiff
Fix cydia://url/ links when they include a slash.
authorGrant Paul <chpwn@chpwn.com>
Mon, 31 Jan 2011 07:31:59 +0000 (23:31 -0800)
committerGrant Paul <chpwn@chpwn.com>
Mon, 31 Jan 2011 07:31:59 +0000 (23:31 -0800)
MobileCydia.mm

index 0076c42307300dbb35992407e889e20b9d31bff9..1596c3807b9ef7a8f195c819b3afbae82328f66e 100644 (file)
@@ -8744,7 +8744,11 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
 
     CYViewController *controller = nil;
 
-    if ([components count] == 1) {
+    if ([base isEqualToString:@"url"]) {
+        controller = [[[CYBrowserController alloc] init] autorelease];
+        NSArray *arguments([components subarrayWithRange:NSMakeRange(1, [components count] - 1)]);
+        [(CYBrowserController *)controller loadURL:[NSURL URLWithString:[arguments componentsJoinedByString:@""]]];
+    } else if ([components count] == 1) {
         if ([base isEqualToString:@"storage"]) {
             controller = [[[CYBrowserController alloc] init] autorelease];
             [(CYBrowserController *)controller loadURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"storage" ofType:@"html"]]];
@@ -8800,11 +8804,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) {
             }
         }
 
-        if ([base isEqualToString:@"url"]) {
-            controller = [[[CYBrowserController alloc] init] autorelease];
-            [(CYBrowserController *)controller loadURL:[NSURL URLWithString:argument]];
-        }
-
         if ([base isEqualToString:@"launch"]) {
             [self launchApplicationWithIdentifier:argument suspended:NO];
             return nil;