We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent af63e40 commit 688fb0cCopy full SHA for 688fb0c
WordPressUtils/src/main/java/org/wordpress/android/util/BlogUtils.java
@@ -22,4 +22,15 @@ public int compare(Object blog1, Object blog2) {
22
return blogName1.compareToIgnoreCase(blogName2);
23
}
24
};
25
+
26
+ /**
27
+ * Return a blog name or blog url (host part only) if trimmed name is an empty string
28
+ */
29
+ public static String getBlogNameFromAccountMap(Map<String, Object> account) {
30
+ String blogName = StringUtils.unescapeHTML(MapUtils.getMapStr(account, "blogName"));
31
+ if (blogName.trim().length() == 0) {
32
+ blogName = StringUtils.getHost(MapUtils.getMapStr(account, "url"));
33
+ }
34
+ return blogName;
35
36
0 commit comments