From 5ef8545f63221db002d14cdcd1c7bac2e96a5e0a Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 18 Oct 2010 18:11:29 -0400
Subject: [PATCH] consolidate generating profile URL, force to lower case

---
 indra/newview/llavataractions.cpp |  9 ++++-----
 indra/newview/llpanelprofile.cpp  | 15 +++++++++++----
 indra/newview/llpanelprofile.h    |  2 ++
 3 files changed, 17 insertions(+), 9 deletions(-)
 mode change 100644 => 100755 indra/newview/llavataractions.cpp
 mode change 100644 => 100755 indra/newview/llpanelprofile.cpp
 mode change 100644 => 100755 indra/newview/llpanelprofile.h

diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
old mode 100644
new mode 100755
index 42701bcff91..219fca66bd6
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -56,6 +56,7 @@
 #include "llmutelist.h"
 #include "llnotificationsutil.h"	// for LLNotificationsUtil
 #include "llpaneloutfitedit.h"
+#include "llpanelprofile.h"
 #include "llrecentpeople.h"
 #include "llsidetray.h"
 #include "lltrans.h"
@@ -319,11 +320,9 @@ void LLAvatarActions::showProfile(const LLUUID& id)
 		std::string first_name,last_name;
 		if (gCacheName->getName(id,first_name,last_name))
 		{
-			llinfos << "opening web profile for " << first_name << "." << last_name << llendl;		
-			std::string url = gSavedSettings.getString("WebProfileURL");
-			LLSD subs;
-			subs["AGENT_NAME"] = first_name + "." + last_name;
-			url = LLWeb::expandURLSubstitutions(url,subs);
+			std::string agent_name = first_name + "." + last_name;
+			llinfos << "opening web profile for " << agent_name << llendl;		
+			std::string url = getProfileURL(agent_name);
 			LLWeb::loadURL(url);
 		}
 		else
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
old mode 100644
new mode 100755
index 00191b17bd4..38683ab5f73
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -38,6 +38,16 @@
 static const std::string PANEL_PICKS = "panel_picks";
 static const std::string PANEL_PROFILE = "panel_profile";
 
+std::string getProfileURL(const std::string& agent_name)
+{
+	std::string url = gSavedSettings.getString("WebProfileURL");
+	LLSD subs;
+	subs["AGENT_NAME"] = agent_name;
+	url = LLWeb::expandURLSubstitutions(url,subs);
+	LLStringUtil::toLower(url);
+	return url;
+}
+
 class LLProfileHandler : public LLCommandHandler
 {
 public:
@@ -50,10 +60,7 @@ class LLProfileHandler : public LLCommandHandler
 		if (params.size() < 1) return false;
 		std::string agent_name = params[0];
 		llinfos << "Profile, agent_name " << agent_name << llendl;
-		std::string url = gSavedSettings.getString("WebProfileURL");
-		LLSD subs;
-		subs["AGENT_NAME"] = agent_name;
-		url = LLWeb::expandURLSubstitutions(url,subs);
+		std::string url = getProfileURL(agent_name);
 		LLWeb::loadURL(url);
 
 		return true;
diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h
old mode 100644
new mode 100755
index 0546c185833..c330a159392
--- a/indra/newview/llpanelprofile.h
+++ b/indra/newview/llpanelprofile.h
@@ -33,6 +33,8 @@
 
 class LLTabContainer;
 
+std::string getProfileURL(const std::string& agent_name);
+
 /**
 * Base class for Profile View and My Profile.
 */
-- 
GitLab