Skip to content
Snippets Groups Projects
Commit 0a2a48b4 authored by ¡Cinder! ㊝'s avatar ¡Cinder! ㊝ :speech_balloon:
Browse files

Parse x-grid-location-info slurs in LLUrlEntrySLLabels too

parent 61e07381
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,7 @@
#include <boost/format.hpp> // <alchemy/>
#define APP_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+(:\\d+)?/app)|(secondlife:///app))"
#define X_GRID_OR_SECONDLIFE_HEADER_REGEX "((x-grid-location-info://[-\\w\\.]+(:\\d+)?/)|(secondlife://))"
// Utility functions
std::string localize_slapp_label(const std::string& url, const std::string& full_name);
......@@ -1243,7 +1244,7 @@ std::string LLUrlEntryTeleport::getLocation(const std::string &url) const
//
LLUrlEntrySL::LLUrlEntrySL()
{
mPattern = boost::regex("secondlife://(\\w+)?(:\\d+)?/\\S+",
mPattern = boost::regex(X_GRID_OR_SECONDLIFE_HEADER_REGEX "(\\w+)?(:\\d+)?/\\S+",
boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_slapp.xml";
mTooltip = LLTrans::getString("TooltipSLAPP");
......@@ -1260,7 +1261,7 @@ std::string LLUrlEntrySL::getLabel(const std::string &url, const LLUrlLabelCallb
//
LLUrlEntrySLLabel::LLUrlEntrySLLabel()
{
mPattern = boost::regex("\\[secondlife://\\S+[ \t]+[^\\]]+\\]",
mPattern = boost::regex("\\[" X_GRID_OR_SECONDLIFE_HEADER_REGEX "\\S+[ \t]+[^\\]]+\\]",
boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_slapp.xml";
mTooltip = LLTrans::getString("TooltipSLAPP");
......
......@@ -684,6 +684,10 @@ namespace tut
testRegex("teleport slurl with label", url,
"XXX [secondlife:///app/teleport/Ahern/50/50/50/ Teleport to Ahern] YYY",
"secondlife:///app/teleport/Ahern/50/50/50/");
testRegex("Standalone agent slurl with label", url,
"[x-grid-location-info://my.grid.com:8002/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about Profile]",
"x-grid-location-info://my.grid.com:8002/app/agent/0e346d8b-4433-4d66-a6b0-fd37083abc4c/about");
}
template<> template<>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment