From ceb752c1331235cc4b10b0431e4293873b785f21 Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Fri, 13 Aug 2021 16:05:32 +0300
Subject: [PATCH] SL-11690 Parse URLs in Group description and Land description

---
 indra/llui/lltextbase.h                                    | 2 ++
 indra/newview/llfloaterland.cpp                            | 4 +++-
 indra/newview/llpanelgroupgeneral.cpp                      | 4 +++-
 indra/newview/skins/default/xui/en/floater_about_land.xml  | 1 +
 indra/newview/skins/default/xui/en/panel_group_general.xml | 1 +
 5 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 4e966b7cefb..f6305b2a530 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -457,6 +457,8 @@ class LLTextBase
 	void					setSkipLinkUnderline(bool skip_link_underline) { mSkipLinkUnderline = skip_link_underline; }
 	bool					getSkipLinkUnderline() { return mSkipLinkUnderline;  }
 
+    void					setParseURLs(bool parse_urls) { mParseHTML = parse_urls; }
+
 	void					setPlainText(bool value) { mPlainText = value;}
 	bool					getPlainText() const { return mPlainText; }
 
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index af0e56e4480..925eaf44fa1 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -452,7 +452,8 @@ BOOL LLPanelLandGeneral::postBuild()
 
 	mEditDesc = getChild<LLTextEditor>("Description");
 	mEditDesc->setCommitOnFocusLost(TRUE);
-	mEditDesc->setCommitCallback(onCommitAny, this);	
+	mEditDesc->setCommitCallback(onCommitAny, this);
+    mEditDesc->setContentTrusted(false);
 	// No prevalidate function - historically the prevalidate function was broken,
 	// allowing residents to put in characters like U+2661 WHITE HEART SUIT, so
 	// preserve that ability.
@@ -749,6 +750,7 @@ void LLPanelLandGeneral::refresh()
 		BOOL can_edit_identity = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_CHANGE_IDENTITY);
 		mEditName->setEnabled(can_edit_identity);
 		mEditDesc->setEnabled(can_edit_identity);
+        mEditDesc->setParseURLs(!can_edit_identity);
 
 		BOOL can_edit_agent_only = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_NO_POWERS);
 		mBtnSetGroup->setEnabled(can_edit_agent_only && !parcel->getIsGroupOwned());
diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp
index 375daf60f88..04d3236bf13 100644
--- a/indra/newview/llpanelgroupgeneral.cpp
+++ b/indra/newview/llpanelgroupgeneral.cpp
@@ -97,6 +97,7 @@ BOOL LLPanelGroupGeneral::postBuild()
 		mEditCharter->setCommitCallback(onCommitAny, this);
 		mEditCharter->setFocusReceivedCallback(boost::bind(onFocusEdit, _1, this));
 		mEditCharter->setFocusChangedCallback(boost::bind(onFocusEdit, _1, this));
+        mEditCharter->setContentTrusted(false);
 	}
 
 	// Options
@@ -575,7 +576,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
 
 	if (mEditCharter)
 	{
-		mEditCharter->setText(gdatap->mCharter);
+        mEditCharter->setParseURLs(!mAllowEdit || !can_change_ident);
+        mEditCharter->setText(gdatap->mCharter);
 	}
 	
 	resetDirty();
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index b2d9e530398..dee5e29a3c1 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -164,6 +164,7 @@
              left_pad="2"
              name="Description"
              spellcheck="true"
+             parse_urls="true"
              top_delta="0"
              width="365"
              word_wrap="true" />
diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml
index e34335a2afc..5eafb5cdf15 100644
--- a/indra/newview/skins/default/xui/en/panel_group_general.xml
+++ b/indra/newview/skins/default/xui/en/panel_group_general.xml
@@ -95,6 +95,7 @@ Hover your mouse over the options for more help.
      layout="topleft"
      max_length="511"
      name="charter"
+     parse_urls="true"
      top="105"
      right="-4"
     bg_readonly_color="DkGray2"
-- 
GitLab