Index: adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/UrlInputOpenerPreference.java |
=================================================================== |
--- a/adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/UrlInputOpenerPreference.java |
+++ b/adblockplussbrowser/src/org/adblockplus/sbrowser/contentblocker/UrlInputOpenerPreference.java |
@@ -20,26 +20,26 @@ package org.adblockplus.sbrowser.content |
import android.app.AlertDialog; |
import android.content.Context; |
import android.os.Bundle; |
import android.preference.EditTextPreference; |
import android.text.Editable; |
import android.text.InputType; |
import android.text.TextWatcher; |
import android.util.AttributeSet; |
-import android.util.Patterns; |
import android.view.KeyEvent; |
import android.view.View; |
import android.view.inputmethod.EditorInfo; |
import android.widget.EditText; |
import android.widget.TextView; |
import android.widget.Toast; |
import org.adblockplus.adblockplussbrowser.R; |
import org.adblockplus.sbrowser.contentblocker.util.PreferenceUtils; |
+import org.apache.commons.validator.routines.DomainValidator; |
public class UrlInputOpenerPreference extends EditTextPreference implements TextWatcher, |
TextView.OnEditorActionListener |
{ |
private OnUrlReadyListener onUrlReadyListener; |
private AlertDialog mAlertDialog; |
@@ -129,17 +129,17 @@ public class UrlInputOpenerPreference ex |
public void setOnUrlReadyListener(OnUrlReadyListener listener) |
{ |
this.onUrlReadyListener = listener; |
} |
private boolean isValidUrl() |
{ |
- return Patterns.WEB_URL.matcher(getUrl()).matches(); |
+ return DomainValidator.getInstance().isValid(getUrl()); |
anton
2017/07/06 06:51:10
it's misleading - we validate URL with Apache DOMA
jens
2017/07/06 08:49:06
The purpose of this change is, to have a reliable
|
} |
private String getUrl() |
{ |
return getEditText().getText().toString(); |
} |
private void setPositiveButtonEnabled(boolean enabled) |