summaryrefslogtreecommitdiff
path: root/indra/newview/llweb.cpp
diff options
context:
space:
mode:
authorMonty Brandenberg <monty@lindenlab.com>2014-09-22 18:51:19 -0400
committerMonty Brandenberg <monty@lindenlab.com>2014-09-22 18:51:19 -0400
commit620817c1c3368d73f1b47b1593a0bcbcf567e297 (patch)
treee37b76dc8d154ab661ab23e6be2b6b098f97e4b2 /indra/newview/llweb.cpp
parent329608d24668b044e16b54ff7a7d0ac592b2b88d (diff)
parent8897e7ca24533e0093825346391f5fa9a37f2427 (diff)
Merge. Refresh from viewer-drano-http-4 after release of 3.7.16.
Diffstat (limited to 'indra/newview/llweb.cpp')
-rwxr-xr-xindra/newview/llweb.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 665671a38f..0312972a22 100755
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -50,6 +50,8 @@
#include "llviewerwindow.h"
#include "llnotificationsutil.h"
+#include <boost/regex.hpp>
+
bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async );
@@ -87,7 +89,8 @@ void LLWeb::loadURL(const std::string& url, const std::string& target, const std
// Force load in the internal browser, as if with a blank target.
loadURLInternal(url, "", uuid);
}
- else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external"))
+
+ else if (useExternalBrowser(url) || (target == "_external"))
{
loadURLExternal(url);
}
@@ -225,3 +228,19 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url,
return LLWeb::escapeURL(expanded_url);
}
+
+//static
+bool LLWeb::useExternalBrowser(const std::string &url)
+{
+ if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_EXTERNAL_ONLY)
+ {
+ return true;
+ }
+ 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);
+ boost::match_results<std::string::const_iterator> matches;
+ return !(boost::regex_search(url, matches, pattern));
+ }
+ return false;
+}