Skip to content

Commit

Permalink
fix #1762: show blog url in the share blog spinner if the blog title …
Browse files Browse the repository at this point in the history
…is an empty string
  • Loading branch information
maxme committed Aug 21, 2014
1 parent 44bb61e commit caa9db0
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,15 @@ public int compare(Object blog1, Object blog2) {
return blogName1.compareToIgnoreCase(blogName2);
}
};

/**
* Return a blog name or blog url (host part only) if trimmed name is an empty string
*/
public static String getBlogNameFromAccountMap(Map<String, Object> account) {
String blogName = StringUtils.unescapeHTML(MapUtils.getMapStr(account, "blogName"));
if (blogName.trim().length() == 0) {
blogName = StringUtils.getHost(MapUtils.getMapStr(account, "url"));
}
return blogName;
}
}

0 comments on commit caa9db0

Please sign in to comment.