mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-01 02:12:58 +08:00
CB-2391: Fix for colons crashing the WebView on ICS, tested on Samsung Galaxy S2
This commit is contained in:
parent
6689827278
commit
9ac4b570e6
@ -51,7 +51,7 @@ public class IceCreamCordovaWebViewClient extends CordovaWebViewClient {
|
|||||||
{
|
{
|
||||||
ret = getWhitelistResponse();
|
ret = getWhitelistResponse();
|
||||||
}
|
}
|
||||||
else if(ret == null && (url.contains("?") || url.contains("#") || needsIceCreamSpaceInAssetUrlFix(url))){
|
else if(ret == null && (url.contains("?") || url.contains("#") || needsIceCreamSpecialsInAssetUrlFix(url))){
|
||||||
ret = generateWebResourceResponse(url);
|
ret = generateWebResourceResponse(url);
|
||||||
}
|
}
|
||||||
else if (ret == null && this.appView.pluginManager != null) {
|
else if (ret == null && this.appView.pluginManager != null) {
|
||||||
@ -83,11 +83,17 @@ public class IceCreamCordovaWebViewClient extends CordovaWebViewClient {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean needsIceCreamSpaceInAssetUrlFix(String url) {
|
private static boolean needsIceCreamSpecialsInAssetUrlFix(String url) {
|
||||||
|
// Encoded Spaces
|
||||||
if (!url.contains("%20")){
|
if (!url.contains("%20")){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// colons
|
||||||
|
if(url.split(":").length <= 2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
switch(android.os.Build.VERSION.SDK_INT){
|
switch(android.os.Build.VERSION.SDK_INT){
|
||||||
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH:
|
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH:
|
||||||
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1:
|
case android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1:
|
||||||
|
Loading…
Reference in New Issue
Block a user