summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCinder <cinder@sdf.org>2015-04-11 15:23:06 -0600
committerCinder <cinder@sdf.org>2015-04-11 15:23:06 -0600
commit5a282abe184323643f1a88f2aba662648059b4e2 (patch)
tree7812f302365118cb017d71f768cb4583abc24f25 /indra/newview
parent5c6cf3e7fb9f592e3a293921175b64b515bac23f (diff)
STORM-2113 - uri parsing cleanup and fixes
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llweb.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index 0f0d9ce703..0be6e49834 100755
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -49,7 +49,7 @@
#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "llnotificationsutil.h"
-
+#include "lluriparser.h"
#include "uriparser/Uri.h"
#include <boost/regex.hpp>
@@ -240,19 +240,10 @@ bool LLWeb::useExternalBrowser(const std::string &url)
}
else if (gSavedSettings.getU32("PreferredBrowserBehavior") == BROWSER_INT_LL_EXT_OTHERS)
{
- 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);
+ LLUriParser up(url);
+ up.normalize();
+ up.extractParts();
+ std::string uri_string = up.host();
boost::regex pattern = boost::regex("\\b(lindenlab.com|secondlife.com)$", boost::regex::perl|boost::regex::icase);
boost::match_results<std::string::const_iterator> matches;