MAINT-6608 FIXED URI parser problem with links with username, password

meow-7.2.2
Mnikolenko Productengine 2016-08-10 13:31:25 +03:00
parent 5924155f29
commit e76b5643ef
3 changed files with 12 additions and 6 deletions

View File

@ -205,9 +205,9 @@ void LLUriParser::glue(std::string& uri) const
uri = first_part + second_part;
}
void LLUriParser::glueFirst(std::string& uri) const
void LLUriParser::glueFirst(std::string& uri, bool use_scheme) const
{
if (mScheme.size())
if (use_scheme && mScheme.size())
{
uri = mScheme;
uri += "://";

View File

@ -60,7 +60,7 @@ public:
void extractParts();
void glue(std::string& uri) const;
void glueFirst(std::string& uri) const;
void glueFirst(std::string& uri, bool use_scheme = true) const;
void glueSecond(std::string& uri) const;
bool test() const;
S32 normalize();

View File

@ -205,9 +205,15 @@ std::string LLUrlEntryBase::urlToGreyQuery(const std::string &url) const
std::string label;
up.extractParts();
up.glueFirst(label);
std::string query = url.substr(label.size());
return query;
up.glueFirst(label, false);
size_t pos = url.find(label);
if (pos == std::string::npos)
{
return "";
}
pos += label.size();
return url.substr(pos);
}