MAINT-5464 FIXED Do not add badge to links that have a port number specified.

meow-7.2.2
AndreyL ProductEngine 2015-10-23 07:52:43 +03:00
parent 966e9efd56
commit 52d30bbbe9
2 changed files with 13 additions and 6 deletions

View File

@ -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";

View File

@ -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",