diff --git a/CMakeLists.txt b/CMakeLists.txt index 4897436..8104916 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (expandurl-mastodon - VERSION 0.9.0 + VERSION 0.9.1 LANGUAGES CXX ) diff --git a/src/url.cpp b/src/url.cpp index c1b9977..7b1bf74 100644 --- a/src/url.cpp +++ b/src/url.cpp @@ -89,6 +89,14 @@ const string strip(const string &url) (*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; }