diff options
Diffstat (limited to 'indra/newview/llslurl.cpp')
-rw-r--r-- | indra/newview/llslurl.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index e4773f99c5..5d20e280b5 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -36,6 +36,8 @@ #include "llweb.h" +#include "llurlregistry.h" + const std::string LLSLURL::PREFIX_SL_HELP = "secondlife://app."; const std::string LLSLURL::PREFIX_SL = "sl://"; const std::string LLSLURL::PREFIX_SECONDLIFE = "secondlife://"; @@ -95,6 +97,20 @@ bool LLSLURL::isSLURL(const std::string& url) return false; } +bool LLSLURL::isValidSLURL(const std::string& url) +{ + std::string temp_url(url); + //"www." may appear in DnD- see description of PREFIX_SLURL_WWW. + // If it is found, we remove it because it isn't expected in regexp. + if (matchPrefix(url, PREFIX_SLURL_WWW)) + { + size_t position = url.find("www."); + temp_url.erase(position,4); + } + + return LLUrlRegistry::getInstance()->isUrl(temp_url); +} + // static bool LLSLURL::isSLURLCommand(const std::string& url) { |