From e8659e0e13c65308ad2f036dc7e7ccff0e665976 Mon Sep 17 00:00:00 2001
From: Tofu Linden <tofu.linden@lindenlab.com>
Date: Mon, 4 Jan 2010 15:11:23 -0800
Subject: DEV-44732  avoidable false-positives on automatic URL finding in chat

---
 indra/llui/llurlentry.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'indra/llui')

diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 983f0a2d49..99eb992ddd 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -201,8 +201,11 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string)
 //
 LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
 {
-	mPattern = boost::regex("(\\bwww\\.\\S+\\.\\S+|\\b[^ \t\n\r\f\v:/]+.com\\S*|\\b[^ \t\n\r\f\v:/]+.net\\S*|\\b[^ \t\n\r\f\v:/]+.edu\\S*|\\b[^ \t\n\r\f\v:/]+.org\\S*)",
-							boost::regex::perl|boost::regex::icase);
+	mPattern = boost::regex("("
+				"\\bwww\\.\\S+\\.\\S+" // www.FOO.BAR
+				"|\\b[^ \t\n\r\f\v:/]+.(?:com|net|edu|org)[^[:space:][:alnum:]]*$" // FOO.net
+				")",
+				boost::regex::perl|boost::regex::icase);
 	mMenuName = "menu_url_http.xml";
 	mTooltip = LLTrans::getString("TooltipHttpUrl");
 }
-- 
cgit v1.2.3