summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llui/llurlentry.cpp5
-rwxr-xr-xindra/llui/tests/llurlentry_test.cpp14
2 files changed, 13 insertions, 6 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 7f6cc22e90..576fff5fb2 100755
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -449,7 +449,10 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
//
LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL()
{
- mPattern = boost::regex("https?://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?\\/\\S*",
+ mPattern = boost::regex("((http://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com)"
+ "|"
+ "(https://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?))"
+ "\\/\\S*",
boost::regex::perl|boost::regex::icase);
mIcon = "Hand";
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 96e94c0f80..dde54c78c4 100755
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -838,17 +838,21 @@ namespace tut
"search something https://marketplace.secondlife.com/products/search on marketplace and test the https",
"https://marketplace.secondlife.com/products/search");
- testRegex("match urls with port", url,
- "let's specify some port http://secondlife.com:888/status",
- "http://secondlife.com:888/status");
+ testRegex("match HTTPS urls with port", url,
+ "let's specify some port https://secondlife.com:888/status",
+ "https://secondlife.com:888/status");
+
+ testRegex("don't match HTTP urls with port", url,
+ "let's specify some port for HTTP http://secondlife.com:888/status",
+ "");
testRegex("don't match urls w/o protocol", url,
"looks like an url something www.marketplace.secondlife.com/products but no https prefix",
"");
testRegex("but with a protocol www is fine", url,
- "so let's add a protocol http://www.marketplace.secondlife.com:8888/products",
- "http://www.marketplace.secondlife.com:8888/products");
+ "so let's add a protocol https://www.marketplace.secondlife.com:8888/products",
+ "https://www.marketplace.secondlife.com:8888/products");
testRegex("don't match urls w/o protocol", url,
"and even no www something secondlife.com/status",