From 805c83bc7ad47acd9e74dfee758e151cba01c605 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 13 Aug 2015 20:59:06 +0200 Subject: [PATCH] Simplify fix for FIRE-16642 --- indra/llcommon/lluriparser.h | 3 +++ indra/llui/llurlentry.cpp | 26 ++++++-------------------- 2 files changed, 9 insertions(+), 20 deletions(-) diff --git a/indra/llcommon/lluriparser.h b/indra/llcommon/lluriparser.h index 2df8085ae6..065625988f 100644 --- a/indra/llcommon/lluriparser.h +++ b/indra/llcommon/lluriparser.h @@ -65,6 +65,9 @@ public: bool test() const; S32 normalize(); + // Getter for mRes + S32 getLastRes() const { return mRes; } + private: S32 parse(); void textRangeToString(UriTextRangeA& textRange, std::string& str); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 3642f0ba69..1b1a0d52d2 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -195,6 +195,10 @@ std::string LLUrlEntryBase::urlToLabelWithGreyQuery(const std::string &url) cons // Unfail URI display //LLUriParser up(unescapeUrl(url)); LLUriParser up(url); + if (up.getLastRes()) + { + return unescapeUrl(url); + } // up.normalize(); @@ -255,16 +259,7 @@ LLUrlEntryHTTP::LLUrlEntryHTTP() std::string LLUrlEntryHTTP::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { - // FIRE-16642: Show invalid Hypergrid node URIs - //return urlToLabelWithGreyQuery(url); - LLUriParser up(url); - if (!up.normalize()) - { - return urlToLabelWithGreyQuery(url); - } - - return url; - // + return urlToLabelWithGreyQuery(url); } std::string LLUrlEntryHTTP::getQuery(const std::string &url) const @@ -341,16 +336,7 @@ LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol() std::string LLUrlEntryHTTPNoProtocol::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { - // FIRE-16642: Show invalid Hypergrid node URIs - //return urlToLabelWithGreyQuery(url); - LLUriParser up(url); - if (!up.normalize()) - { - return urlToLabelWithGreyQuery(url); - } - - return url; - // + return urlToLabelWithGreyQuery(url); } std::string LLUrlEntryHTTPNoProtocol::getQuery(const std::string &url) const