[
https://issues.apache.org/jira/browse/CB-14061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16481597#comment-16481597
]
ASF GitHub Bot commented on CB-14061:
-------------------------------------
jcesarmobile closed pull request #269: CB-14061: (android) comply with RFC 3986
for custom URL scheme handling
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/269
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
index 9b3388ced..1453155b5 100644
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@ -1112,7 +1112,7 @@ else if (url.startsWith("sms:")) {
}
}
// Test for whitelisted custom scheme names like mycoolapp:// or
twitteroauthresponse:// (Twitter Oauth Response)
- else if (!url.startsWith("http:") && !url.startsWith("https:") &&
url.matches("^[a-z]*://.*?$")) {
+ else if (!url.startsWith("http:") && !url.startsWith("https:") &&
url.matches("^[A-Za-z0-9+.-]*://.*?$")) {
if (allowedSchemes == null) {
String allowed = preferences.getString("AllowedSchemes",
"");
allowedSchemes = allowed.split(",");
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> cordova-plugin-inappbrowser should allow more custom URL schemes
> ----------------------------------------------------------------
>
> Key: CB-14061
> URL: https://issues.apache.org/jira/browse/CB-14061
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-plugin-inappbrowser
> Affects Versions: 3.0.0
> Reporter: Tim Brust
> Priority: Minor
>
> The current Android regexp (^[a-z]*://.*?$)
> (https://github.com/apache/cordova-plugin-inappbrowser/blob/master/src/android/InAppBrowser.java#L1115)
> does not allow schemes like d2d or develop+d2d.
> According to RFC 3986 (quoting) "Scheme names consist of a sequence of
> characters beginning with a letter and followed by any combination of
> letters, digits, plus ("+"), period ("."), or hyphen ("-")"
> (https://tools.ietf.org/html/rfc3986#section-3.1)
>
> The regexp should be expanded to allow numbers, plus, periods and hyphens.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]