diff options
| author | Ben Murdoch <benm@google.com> | 2009-10-12 10:29:00 +0100 |
|---|---|---|
| committer | Ben Murdoch <benm@google.com> | 2009-10-14 10:59:12 +0100 |
| commit | de353621650d17a412b6ffe2cbf0366db5f11c40 (patch) | |
| tree | d2fc420b0e279d642432e994c1d8432671cd7fdd /src/com/android/browser/AddBookmarkPage.java | |
| parent | 94b10fe271909535c559527a5b5edcdc61b435a0 (diff) | |
Don't allow the user to save bookmarks with a scheme that the Browser cannot directly handle.
Change-Id: I9cbdfeaaeef4ded3dac1623854ecb9c5c603eb91
Diffstat (limited to 'src/com/android/browser/AddBookmarkPage.java')
| -rw-r--r-- | src/com/android/browser/AddBookmarkPage.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java index 81123ba2..9ab8473d 100644 --- a/src/com/android/browser/AddBookmarkPage.java +++ b/src/com/android/browser/AddBookmarkPage.java @@ -182,9 +182,14 @@ public class AddBookmarkPage extends Activity { try { URI uriObj = new URI(url); String scheme = uriObj.getScheme(); - if (!("about".equals(scheme) || "data".equals(scheme) - || "javascript".equals(scheme) - || "file".equals(scheme) || "content".equals(scheme))) { + if (!Bookmarks.urlHasAcceptableScheme(url)) { + // If the scheme was non-null, let the user know that we + // can't save their bookmark. If it was null, we'll assume + // they meant http when we parse it in the WebAddress class. + if (scheme != null) { + mAddress.setError(r.getText(R.string.bookmark_cannot_save_url)); + return false; + } WebAddress address; try { address = new WebAddress(unfilteredUrl); |
