diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 8bf38caeb..9c26f23ab 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -41,6 +41,7 @@ //#include "lluicolortable.h" #include "message.h" +#include #include // #define APP_HEADER_REGEX "((((x-grid-info://)|(x-grid-location-info://))[-\\w\\.]+(:\\d+)?/app)|(secondlife:///app))" @@ -120,11 +121,11 @@ std::string LLUrlEntryBase::getLabelFromWikiLink(const std::string &url) const size_t start = 0; while (! isspace(text[start])) { - start++; + ++start; } while (text[start] == ' ' || text[start] == '\t') { - start++; + ++start; } return unescapeUrl(url.substr(start, url.size()-start-1)); } @@ -136,7 +137,7 @@ std::string LLUrlEntryBase::getUrlFromWikiLink(const std::string &string) const size_t end = 0; while (! isspace(text[end])) { - end++; + ++end; } return escapeUrl(string.substr(1, end-1)); } @@ -273,7 +274,7 @@ std::string LLUrlEntryHTTP::getTooltip(const std::string &url) const // LLUrlEntryHTTPLabel::LLUrlEntryHTTPLabel() { - mPattern = boost::regex("\\[https?://\\S+[ \t]+[^\\]]+\\]", + mPattern = boost::regex("\\[(https?://\\S+|\\S+\\.([^\\s<]*)?)[ \t]+[^\\]]+\\]", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_http.xml"; mTooltip = LLTrans::getString("TooltipHttpUrl"); @@ -292,7 +293,10 @@ std::string LLUrlEntryHTTPLabel::getTooltip(const std::string &string) const std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string) const { - return getUrlFromWikiLink(string); + auto url = getUrlFromWikiLink(string); + if (!boost::istarts_with(url, "http")) + return "http://" + url; + return url; } //