diff --git a/indra/llcommon/llavatarname.h b/indra/llcommon/llavatarname.h
index 2f8c534974bc3b7e84ab09aef6604e84afa585ba..4827353018ef15b0cda7974ed5c5bfd5c1eab926 100644
--- a/indra/llcommon/llavatarname.h
+++ b/indra/llcommon/llavatarname.h
@@ -74,6 +74,9 @@ class LL_COMMON_API LLAvatarName
 	// Also used for backwards compatibility with systems like voice and muting
 	std::string getUserName() const;
 	
+	// Returns "james.linden" or the legacy name for very old names
+	std::string getAccountName() const { return mUsername; }
+
 	// Debug print of the object
 	void dump() const;
 	
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 59b862503c95ebfe0a8248ed5f6ea5844ea0f042..23d528901a39a8e7cc161efdf840fc96dd069131 100755
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -315,15 +315,11 @@ static const char* get_profile_floater_name(const LLUUID& avatar_id)
 
 static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarName& av_name)
 {
-	std::string username = av_name.getUserName();
-	
-	llinfos << "opening web profile for " << username << llendl;		
-	std::string url = getProfileURL(username);
+	std::string url = getProfileURL(av_name.getAccountName());
 
 	// PROFILES: open in webkit window
 	LLFloaterWebContent::Params p;
-	p.url(url).
-		id(agent_id.asString());
+	p.url(url).id(agent_id.asString());
 	LLFloaterReg::showInstance(get_profile_floater_name(agent_id), p);
 }