Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
[HBLOMapsOpenerHandler] fix comgooglemapsurl:// looping and crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
kirb committed Oct 9, 2015
1 parent 9de22bb commit a4886c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion HBLOMapsOpenerHandler.x
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@
missing data
*/
return [url.host isEqualToString:@"mapitem"] ? nil : url;
} else if ([url.host hasPrefix:@"maps.google."] || (([url.host hasPrefix:@"google."] || [url.host hasPrefix:@"www.google."] || [url.host isEqualToString:@"goo.gl"]) && url.pathComponents.count > 2 && [url.pathComponents[1] isEqualToString:@"maps"])) {
} else if (
([url.scheme isEqualToString:@"http"] || [url.scheme isEqualToString:@"https"]) && // scheme is https?:, and
([url.host hasPrefix:@"maps.google."] || // host is maps.google.TLD, or
(
([url.host hasPrefix:@"google."] || [url.host hasPrefix:@"www.google."] || [url.host isEqualToString:@"goo.gl"]) // google.TLD or goo.gl, and
&& url.pathComponents.count > 2 && [url.pathComponents[1] isEqualToString:@"maps"] // we have >2 path components; the first is "maps"
)
)) {
/*
matches the regex from the docs:
Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: ws.hbang.mapsopener
Name: MapsOpener
Pre-Depends: firmware (>= 5.1)
Depends: mobilesubstrate, ws.hbang.libopener (>= 2.0)
Version: 1.5.1
Version: 1.5.2
Architecture: iphoneos-arm
Description: Open map links in Google Maps
Maintainer: HASHBANG Productions <[email protected]>
Expand Down

0 comments on commit a4886c3

Please sign in to comment.