Skip to content

Commit 83eb9d1

Browse files
committed
Better solution: Fix the url within PhotonUtils. Hattip @nbradbury
1 parent 47d1e59 commit 83eb9d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

WordPressUtils/src/main/java/org/wordpress/android/util/PhotonUtils.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ public static String getPhotonImageUrl(String imageUrl, int width, int height, Q
8888
return imageUrl + query;
8989
}
9090

91+
// use wordpress.com as the host if image is on wordpress.com since it supports the same
92+
// query params and, more importantly, can handle images in private blogs
93+
if (imageUrl.contains("wordpress.com")) {
94+
return imageUrl + query;
95+
}
96+
9197
// must use https for https image urls
9298
if (UrlUtils.isHttps(imageUrl)) {
9399
return "https://i0.wp.com/" + imageUrl.substring(schemePos+3, imageUrl.length()) + query;

0 commit comments

Comments
 (0)