Bug 1035131 - User decoded user entered URLs in suggeste image lookups (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Mon, 07 Jul 2014 15:59:53 +0100
changeset 192622 f26a0f525fb457c09ccd0c4e52a7be82372391fe
parent 192621 b459090bc1e3f4c3a75384f9f3f9dbf34657d297
child 192623 f14b47c390139d38f340918d15d95165642bde5c
push id27091
push userkwierso@gmail.com
push dateMon, 07 Jul 2014 21:11:34 +0000
treeherdermozilla-central@f14b47c39013 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs1035131
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1035131 - User decoded user entered URLs in suggeste image lookups (r=mfinkle)
mobile/android/base/home/TopSitesPanel.java
--- a/mobile/android/base/home/TopSitesPanel.java
+++ b/mobile/android/base/home/TopSitesPanel.java
@@ -550,21 +550,24 @@ public class TopSitesPanel extends HomeF
             // Thumbnails are delivered late, so we can't short-circuit any
             // sooner than this. But we can avoid a duplicate favicon
             // fetch...
             if (!updated) {
                 debug("bindView called twice for same values; short-circuiting.");
                 return;
             }
 
+            // Make sure we query suggested images without the user-entered wrapper.
+            final String decodedUrl = StringUtils.decodeUserEnteredUrl(url);
+
             // Suggested images have precedence over thumbnails, no need to wait
             // for them to be loaded. See: CursorLoaderCallbacks.onLoadFinished()
-            final String imageUrl = BrowserDB.getSuggestedImageUrlForUrl(url);
+            final String imageUrl = BrowserDB.getSuggestedImageUrlForUrl(decodedUrl);
             if (!TextUtils.isEmpty(imageUrl)) {
-                final int bgColor = BrowserDB.getSuggestedBackgroundColorForUrl(url);
+                final int bgColor = BrowserDB.getSuggestedBackgroundColorForUrl(decodedUrl);
                 view.displayThumbnail(imageUrl, bgColor);
                 return;
             }
 
             // If thumbnails are still being loaded, don't try to load favicons
             // just yet. If we sent in a thumbnail, we're done now.
             if (mThumbnails == null || thumbnail != null) {
                 return;