diff options
author | maxim@mnikolenko <maxim@mnikolenko> | 2014-05-28 13:20:12 +0300 |
---|---|---|
committer | maxim@mnikolenko <maxim@mnikolenko> | 2014-05-28 13:20:12 +0300 |
commit | 72dba8742c3120fcb76b42aa6ede796bdad8554d (patch) | |
tree | d33890b434ad892496e5fc70b0f2cdad7c69907a /indra/llui/llurlregistry.cpp | |
parent | c84217cc5bf49354b39ea3521e4805c791a15c8c (diff) |
MAINT-4070 FIXED Use icon in urls when content is trusted.
Diffstat (limited to 'indra/llui/llurlregistry.cpp')
-rwxr-xr-x | indra/llui/llurlregistry.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 523ee5d78c..bccc646821 100755 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -41,7 +41,8 @@ LLUrlRegistry::LLUrlRegistry() // Urls are matched in the order that they were registered registerUrl(new LLUrlEntryNoLink()); - registerUrl(new LLUrlEntryIcon()); + mUrlEntryIcon = new LLUrlEntryIcon(); + registerUrl(mUrlEntryIcon); registerUrl(new LLUrlEntrySLURL()); registerUrl(new LLUrlEntryHTTP()); registerUrl(new LLUrlEntryHTTPLabel()); @@ -145,7 +146,7 @@ static bool stringHasUrl(const std::string &text) text.find("<icon") != std::string::npos); } -bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb) +bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LLUrlLabelCallback &cb, bool is_content_trusted) { // avoid costly regexes if there is clearly no URL in the text if (! stringHasUrl(text)) @@ -160,6 +161,12 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL std::vector<LLUrlEntryBase *>::iterator it; for (it = mUrlEntry.begin(); it != mUrlEntry.end(); ++it) { + //Skip for url entry icon if content is not trusted + if(!is_content_trusted && (mUrlEntryIcon == *it)) + { + continue; + } + LLUrlEntryBase *url_entry = *it; U32 start = 0, end = 0; |