Skip to content

Commit 0bcf361

Browse files
committed
RPD-2850 Fixed logic condition to prevent grabbing URLs or deeplinks containing "http" as middle expressions
1 parent 1ccbce9 commit 0bcf361

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

OneSignalSDK/onesignal/src/main/java/com/onesignal/OneSignal.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,10 @@ private static boolean openURLFromNotification(Context context, JSONArray dataAr
14131413
if (customJSON.has("u")) {
14141414
String url = customJSON.optString("u", null);
14151415

1416-
if (!url.contains("http")) {
1416+
if (!url.contains("://"))
1417+
url = "http://" + url;
1418+
1419+
if (!url.startsWith("http")) {
14171420
intent = new Intent(Intent.ACTION_MAIN, Uri.parse(url.trim()));
14181421
intent.addCategory(Intent.CATEGORY_LAUNCHER);
14191422
}

0 commit comments

Comments
 (0)