summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2015-07-31 12:27:36 +0300
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2015-07-31 12:27:36 +0300
commitd04a3b6d4e67dafa0b6dd8e88b752c5a929de5b0 (patch)
tree78dafba580fb9281d2bf305a9fb5bd20719fa329
parent287e1bafb286820e3d7d89c59082c72f622a53be (diff)
MAINT-5127 FIXED Maps URLs copied from gcal inherit special characters that do odd things
-rwxr-xr-xindra/llui/llurlregistry.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index decb9c9bc2..69eefa736c 100755
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -214,6 +214,7 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
// did we find a match? if so, return its details in the match object
if (match_entry)
{
+
// Skip if link is an email with an empty username (starting with @). See MAINT-5371.
if (match_start > 0 && text.substr(match_start - 1, 1) == "@")
return false;
@@ -221,6 +222,32 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
// fill in the LLUrlMatch object and return it
std::string url = text.substr(match_start, match_end - match_start + 1);
+ LLUrlEntryBase *stripped_entry = NULL;
+ if(LLStringUtil::containsNonprintable(url))
+ {
+ LLStringUtil::stripNonprintable(url);
+
+ std::vector<LLUrlEntryBase *>::iterator iter;
+ for (iter = mUrlEntry.begin(); iter != mUrlEntry.end(); ++iter)
+ {
+ LLUrlEntryBase *url_entry = *iter;
+ U32 start = 0, end = 0;
+ if (matchRegex(url.c_str(), url_entry->getPattern(), start, end))
+ {
+ if (mLLUrlEntryInvalidSLURL == *iter)
+ {
+ if(url_entry && url_entry->isSLURLvalid(url))
+ {
+ continue;
+ }
+ }
+ stripped_entry = url_entry;
+ break;
+ }
+ }
+ }
+
+
if (match_entry == mUrlEntryTrusted)
{
LLUriParser up(url);
@@ -228,10 +255,12 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
url = up.normalizedUri();
}
+ std::string url_label = stripped_entry? stripped_entry->getLabel(url, cb) : match_entry->getLabel(url, cb);
+ std::string url_query = stripped_entry? stripped_entry->getQuery(url) : match_entry->getQuery(url);
match.setValues(match_start, match_end,
match_entry->getUrl(url),
- match_entry->getLabel(url, cb),
- match_entry->getQuery(url),
+ url_label,
+ url_query,
match_entry->getTooltip(url),
match_entry->getIcon(url),
match_entry->getStyle(),