summaryrefslogtreecommitdiff
path: root/indra/newview/llweb.cpp
diff options
context:
space:
mode:
authorCinder Biscuits <cinder@alchemyviewer.org>2015-02-26 14:55:50 -0700
committerCinder Biscuits <cinder@alchemyviewer.org>2015-02-26 14:55:50 -0700
commitd9673d6c1d67ac104fc7872ea2da88560832dd28 (patch)
treeb2ab207152ee7b025eab69eed03733819bdf3d05 /indra/newview/llweb.cpp
parent4665d35453f00fcccd6e17ea84d0549f62b07c5f (diff)
parentd4a2e9fd9a0e7001a6c824ddd6cf37039a632b9d (diff)
Merged lindenlab/viewer-tools-update into default
Diffstat (limited to 'indra/newview/llweb.cpp')
-rwxr-xr-xindra/newview/llweb.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 0312972a22..0f0d9ce703 100755
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -50,6 +50,8 @@
#include "llviewerwindow.h"
#include "llnotificationsutil.h"
+#include "uriparser/Uri.h"
+
#include <boost/regex.hpp>
bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async );
@@ -238,9 +240,23 @@ bool LLWeb::useExternalBrowser(const std::string &url)
}
else if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_INT_LL_EXT_OTHERS)
{
- boost::regex pattern = boost::regex("\\b(lindenlab.com|secondlife.com)\\b", boost::regex::perl|boost::regex::icase);
+ UriParserStateA state;
+ UriUriA uri;
+ state.uri = &uri;
+
+ std::string uri_string = url;
+ uriParseUriA(&state, uri_string.c_str());
+ if (uri.hostText.first)
+ {
+ S32 length = uri.hostText.afterLast - uri.hostText.first;
+ std::string buf = uri.hostText.first;
+ uri_string = buf.substr(0,length);
+ }
+ uriFreeUriMembersA(&uri);
+
+ boost::regex pattern = boost::regex("\\b(lindenlab.com|secondlife.com)$", boost::regex::perl|boost::regex::icase);
boost::match_results<std::string::const_iterator> matches;
- return !(boost::regex_search(url, matches, pattern));
+ return !(boost::regex_search(uri_string, matches, pattern));
}
return false;
}