Bugfix: Made sure that the first parameter has a leading '?'
This commit is contained in:
parent
f3db10dc0a
commit
46aa2b89c3
|
@ -1,6 +1,6 @@
|
||||||
cmake_minimum_required (VERSION 3.7)
|
cmake_minimum_required (VERSION 3.7)
|
||||||
project (expandurl-mastodon
|
project (expandurl-mastodon
|
||||||
VERSION 0.9.0
|
VERSION 0.9.1
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,14 @@ const string strip(const string &url)
|
||||||
(*it).asString());
|
(*it).asString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If '&' is found in the new URL, but no '?'
|
||||||
|
if (newurl.find('&') != std::string::npos &&
|
||||||
|
newurl.find('?') == std::string::npos)
|
||||||
|
{
|
||||||
|
size_t pos = newurl.find('&');
|
||||||
|
newurl.replace(pos, 1, "?");
|
||||||
|
}
|
||||||
|
|
||||||
return newurl;
|
return newurl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user