Fixed major bug EXT-4876 (Switch from slurl.com to maps.secondlife.com)
--HG-- branch : product-enginemeow-7.2.2
parent
7e1911baa2
commit
8c1618ca5a
|
|
@ -232,7 +232,7 @@ std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const
|
|||
LLUrlEntrySLURL::LLUrlEntrySLURL()
|
||||
{
|
||||
// see http://slurl.com/about.php for details on the SLURL format
|
||||
mPattern = boost::regex("http://slurl.com/secondlife/\\S+/?(\\d+)?/?(\\d+)?/?(\\d+)?/?\\S*",
|
||||
mPattern = boost::regex("http://(maps.secondlife.com|slurl.com)/secondlife/\\S+/?(\\d+)?/?(\\d+)?/?(\\d+)?/?\\S*",
|
||||
boost::regex::perl|boost::regex::icase);
|
||||
mMenuName = "menu_url_slurl.xml";
|
||||
mTooltip = LLTrans::getString("TooltipSLURL");
|
||||
|
|
|
|||
|
|
@ -39,7 +39,8 @@
|
|||
const std::string LLSLURL::PREFIX_SL_HELP = "secondlife://app.";
|
||||
const std::string LLSLURL::PREFIX_SL = "sl://";
|
||||
const std::string LLSLURL::PREFIX_SECONDLIFE = "secondlife://";
|
||||
const std::string LLSLURL::PREFIX_SLURL = "http://slurl.com/secondlife/";
|
||||
const std::string LLSLURL::PREFIX_SLURL_OLD = "http://slurl.com/secondlife/";
|
||||
const std::string LLSLURL::PREFIX_SLURL = "http://maps.secondlife.com/secondlife/";
|
||||
|
||||
const std::string LLSLURL::APP_TOKEN = "app/";
|
||||
|
||||
|
|
@ -63,6 +64,11 @@ std::string LLSLURL::stripProtocol(const std::string& url)
|
|||
{
|
||||
stripped.erase(0, PREFIX_SLURL.length());
|
||||
}
|
||||
else if (matchPrefix(stripped, PREFIX_SLURL_OLD))
|
||||
{
|
||||
stripped.erase(0, PREFIX_SLURL_OLD.length());
|
||||
}
|
||||
|
||||
|
||||
return stripped;
|
||||
}
|
||||
|
|
@ -74,6 +80,7 @@ bool LLSLURL::isSLURL(const std::string& url)
|
|||
if (matchPrefix(url, PREFIX_SL)) return true;
|
||||
if (matchPrefix(url, PREFIX_SECONDLIFE)) return true;
|
||||
if (matchPrefix(url, PREFIX_SLURL)) return true;
|
||||
if (matchPrefix(url, PREFIX_SLURL_OLD)) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
@ -83,7 +90,8 @@ bool LLSLURL::isSLURLCommand(const std::string& url)
|
|||
{
|
||||
if (matchPrefix(url, PREFIX_SL + APP_TOKEN) ||
|
||||
matchPrefix(url, PREFIX_SECONDLIFE + "/" + APP_TOKEN) ||
|
||||
matchPrefix(url, PREFIX_SLURL + APP_TOKEN) )
|
||||
matchPrefix(url, PREFIX_SLURL + APP_TOKEN) ||
|
||||
matchPrefix(url, PREFIX_SLURL_OLD + APP_TOKEN) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ public:
|
|||
static const std::string PREFIX_SL;
|
||||
static const std::string PREFIX_SECONDLIFE;
|
||||
static const std::string PREFIX_SLURL;
|
||||
static const std::string PREFIX_SLURL_OLD;
|
||||
|
||||
static const std::string APP_TOKEN;
|
||||
|
||||
|
|
|
|||
|
|
@ -1478,6 +1478,11 @@ void inventory_offer_handler(LLOfferInfo* info)
|
|||
// Strip any SLURL from the message display. (DEV-2754)
|
||||
std::string msg = info->mDesc;
|
||||
int indx = msg.find(" ( http://slurl.com/secondlife/");
|
||||
if(indx == std::string::npos)
|
||||
{
|
||||
// try to find new slurl host
|
||||
indx = msg.find(" ( http://maps.secondlife.com/secondlife/");
|
||||
}
|
||||
if(indx >= 0)
|
||||
{
|
||||
LLStringUtil::truncate(msg, indx);
|
||||
|
|
|
|||
Loading…
Reference in New Issue