From 3345d5f28d833942056eb8d6e96c4d635bc5cbcd Mon Sep 17 00:00:00 2001 From: Ansariel Date: Wed, 25 Feb 2015 20:24:20 +0100 Subject: [PATCH] Fail fixing: Only normalize trusted URLs that have been matched by LLUrlEntrySeconlifeURL --- indra/llui/llurlregistry.cpp | 8 ++++++-- indra/llui/llurlregistry.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index ce4c935234..524aaead14 100755 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -55,7 +55,11 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntrySLURL()); // decorated links for host names like: secondlife.com and lindenlab.com - registerUrl(new LLUrlEntrySeconlifeURL()); + // Normalize only trusted URL + //registerUrl(new LLUrlEntrySeconlifeURL()); + mUrlEntryTrustedUrl = new LLUrlEntrySeconlifeURL(); + registerUrl(mUrlEntryTrustedUrl); + // registerUrl(new LLUrlEntryHTTP()); mUrlEntryHTTPLabel = new LLUrlEntryHTTPLabel(); @@ -266,7 +270,7 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL std::string url = text.substr(match_start, match_end - match_start + 1); // Fix the "nolink>" fail; Fix from Alchemy viewer, courtesy of Drake Arconis - if (match_entry != mUrlEntryNoLink) + if (match_entry != mUrlEntryNoLink && match_entry == mUrlEntryTrustedUrl) { // LLUriParser up(url); diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h index fa6353614f..e075e6fae6 100755 --- a/indra/llui/llurlregistry.h +++ b/indra/llui/llurlregistry.h @@ -98,6 +98,8 @@ private: LLUrlEntryBase* mUrlEntrySLLabel; // Fix the "nolink>" fail; Fix from Alchemy viewer, courtesy of Drake Arconis LLUrlEntryBase* mUrlEntryNoLink; + // Normalize only trusted URL + LLUrlEntryBase* mUrlEntryTrustedUrl; }; #endif