From 5a282abe184323643f1a88f2aba662648059b4e2 Mon Sep 17 00:00:00 2001 From: Cinder Date: Sat, 11 Apr 2015 15:23:06 -0600 Subject: STORM-2113 - uri parsing cleanup and fixes --- indra/llui/llurlregistry.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'indra/llui/llurlregistry.cpp') diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 9e8d8d01f1..0f42a1a80c 100755 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -47,7 +47,7 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntrySLURL()); // decorated links for host names like: secondlife.com and lindenlab.com - registerUrl(new LLUrlEntrySeconlifeURL()); + registerUrl(new LLUrlEntrySecondlifeURL()); registerUrl(new LLUrlEntryHTTP()); mUrlEntryHTTPLabel = new LLUrlEntryHTTPLabel(); @@ -209,9 +209,12 @@ 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); - LLUriParser up(url); - up.normalize(); - url = up.normalizedUri(); + if (match_entry == mUrlEntryTrusted) + { + LLUriParser up(url); + up.normalize(); + url = up.normalizedUri(); + } match.setValues(match_start, match_end, match_entry->getUrl(url), @@ -243,7 +246,7 @@ bool LLUrlRegistry::findUrl(const LLWString &text, LLUrlMatch &match, const LLUr // character encoding, so we need to update the start // and end values to be correct for the wide string. LLWString wurl = utf8str_to_wstring(match.getUrl()); - S32 start = text.find(wurl); + size_t start = text.find(wurl); if (start == std::string::npos) { return false; -- cgit v1.2.3