Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B Bolts-ObjC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 34
    • Issues 34
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • BoltsFramework
  • Bolts-ObjC
  • Merge requests
  • !128
An error occurred while fetching the assigned milestone of the selected merge_request.

Fixed crash when creating a BFURL when target_url is null.

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Nikita Lutsenko requested to merge nlutsenko.targetURL into master 9 years ago
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 2

Verify that the string is actually a string. This eliminates potential problems like if the URL is a number or anything else shady. Fixes #114 (closed).

Compare
  • master (base)

and
  • latest version
    93e4f57c
    1 commit, 2 years ago

2 files
+ 11
- 1

    Preferences

    File browser
    Compare changes
Bolt‎s/iOS‎
BFU‎RL.m‎ +1 -1
Bolts‎Tests‎
AppLink‎Tests.m‎ +10 -0
Bolts/iOS/BFURL.m
+ 1
- 1
  • View file @ 93e4f57c

  • Edit in single-file editor

  • Open in Web IDE


@@ -54,7 +54,7 @@ FOUNDATION_EXPORT NSString *const BFAppLinkRefererUrl;
if (applinkExtras && [applinkExtras isKindOfClass:[NSDictionary class]]) {
_appLinkExtras = applinkExtras;
}
_targetURL = target ? [NSURL URLWithString:target] : url;
_targetURL = ([target isKindOfClass:[NSString class]] ? [NSURL URLWithString:target] : url);
_targetQueryParameters = [BFURL queryParametersForURL:_targetURL];
NSDictionary *refererAppLink = _appLinkData[BFAppLinkRefererAppLink];
BoltsTests/AppLinkTests.m
+ 10
- 0
  • View file @ 93e4f57c

  • Edit in single-file editor

  • Open in Web IDE


@@ -179,6 +179,16 @@ NSMutableArray *openedUrls = nil;
XCTAssertEqualObjects(url.absoluteString, openedURL.inputURL.absoluteString);
}
- (void)testOpenedURLWithBadTarget {
NSURL *url = [NSURL URLWithString:@"bolts://?al_applink_data=%7B%22user_agent%22%3A%22Bolts%20iOS%201.0.0%22%2C%22target_url%22%3Anull%7D"];
BFURL *openedURL = [BFURL URLWithURL:url];
XCTAssertEqualObjects(url, openedURL.targetURL);
XCTAssert(openedURL.appLinkData[@"user_agent"]);
XCTAssertEqualObjects(url.absoluteString, openedURL.inputURL.absoluteString);
}
- (void)testOpenedIncomingURLWithAppLinkWillPostEvent {
NSURL *url = [NSURL URLWithString:@"bolts://?foo=bar&al_applink_data=%7B%22a%22%3A%22b%22%2C%22user_agent%22%3A%22Bolts%20iOS%201.0.0%22%2C%22target_url%22%3A%22http%3A%5C%2F%5C%2Fwww.example.com%5C%2Fpath%3Fbaz%3Dbat%22%7D"];
NSString *sourceApplication = @"com.example.referer";
Assignee
Nikita Lutsenko's avatar
Nikita Lutsenko
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
0
0 participants
Reference:
Source branch: nlutsenko.targetURL

Menu

Explore Projects Groups Snippets