summaryrefslogtreecommitdiff
path: root/indra/newview/llweb.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llweb.cpp')
-rw-r--r--indra/newview/llweb.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index c056c84e19..18f61501dc 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -38,11 +38,19 @@
// Library includes
#include "llwindow.h" // spawnWebBrowser()
-#include "llviewerwindow.h"
-#include "llviewercontrol.h"
+#include "llalertdialog.h"
+#include "llappviewer.h"
#include "llfloatermediabrowser.h"
#include "llfloaterreg.h"
+#include "lllogininstance.h"
+#include "llsd.h"
#include "lltoastalertpanel.h"
+#include "llui.h"
+#include "lluri.h"
+#include "llversioninfo.h"
+#include "llviewercontrol.h"
+#include "llviewernetwork.h"
+#include "llviewerwindow.h"
class URLLoader : public LLToastAlertPanel::URLLoader
{
@@ -122,3 +130,24 @@ std::string LLWeb::escapeURL(const std::string& url)
}
return escaped_url;
}
+
+//static
+std::string LLWeb::expandURLSubstitutions(const std::string &url,
+ const LLSD &default_subs)
+{
+ LLSD substitution = default_subs;
+ substitution["VERSION"] = LLVersionInfo::getVersion();
+ substitution["VERSION_MAJOR"] = LLVersionInfo::getMajor();
+ substitution["VERSION_MINOR"] = LLVersionInfo::getMinor();
+ substitution["VERSION_PATCH"] = LLVersionInfo::getPatch();
+ substitution["VERSION_BUILD"] = LLVersionInfo::getBuild();
+ substitution["CHANNEL"] = LLVersionInfo::getChannel();
+ substitution["LANGUAGE"] = LLUI::getLanguage();
+ substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel();
+ substitution["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple();
+
+ std::string expanded_url = url;
+ LLStringUtil::format(expanded_url, substitution);
+
+ return LLWeb::escapeURL(expanded_url);
+}