From 94ce45441d3e00a8ff2dac6c41be23fa04cee31b Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Sat, 10 Apr 2021 01:38:17 +0300
Subject: [PATCH] SL-15082 regexp fix

---
 indra/llui/llurlentry.cpp            | 2 +-
 indra/llui/tests/llurlentry_test.cpp | 5 -----
 indra/newview/llviewerregion.cpp     | 2 +-
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 06e7070f7e0..6ff1b0764ec 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -1103,7 +1103,7 @@ std::string LLUrlEntryPlace::getLocation(const std::string &url) const
 //
 LLUrlEntryRegion::LLUrlEntryRegion()
 {
-	mPattern = boost::regex("secondlife:///app/region/[A-Za-z0-9]+(/\\d+)?(/\\d+)?(/\\d+)?/?",
+	mPattern = boost::regex("secondlife:///app/region/[A-Za-z0-9()_%]+(/\\d+)?(/\\d+)?(/\\d+)?/?",
 							boost::regex::perl|boost::regex::icase);
 	mMenuName = "menu_url_slurl.xml";
 	mTooltip = LLTrans::getString("TooltipSLURL");
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 4a4fdb72e3f..1a474cca90b 100644
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -739,11 +739,6 @@ namespace tut
 				  "XXX secondlife:///app/region/Burning%20Life%20(Hyper)/27/210/30 XXX",
 				  "secondlife:///app/region/Burning%20Life%20(Hyper)/27/210/30");
 
-		// DEV-35459: SLURLs and teleport Links not parsed properly
-		testRegex("Region with quote", url,
-				  "XXX secondlife:///app/region/A'ksha%20Oasis/41/166/701 XXX",
-			          "secondlife:///app/region/A%27ksha%20Oasis/41/166/701");
-
 		// Rendering tests.
 		testLabel("Render /app/region/Ahern/50/50/50/", url,
 			"secondlife:///app/region/Ahern/50/50/50/",
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 359930b2cd4..7628a6c7ef1 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -145,7 +145,7 @@ class LLRegionHandler : public LLCommandHandler
            
         // build a secondlife://{PLACE} SLurl from this SLapp
         std::string url = "secondlife://";
-		boost::regex name_rx("[A-Za-z0-9]+");
+		boost::regex name_rx("[A-Za-z0-9()_%]+");
 		boost::regex coord_rx("[0-9]+");
         for (int i = 0; i < num_params; i++)
         {
-- 
GitLab