Add LLWeb::curlEscape

Since curl 7.21.2 - (October 13 2010), curl_escape (a deprecated
function that will be removed in the future) changed it's behavior
and no longer escapes the characters '-', '.', '_' and '~'.

The only reasonable solution for us is to stop using it and
use our own version that mimics the old behavior. The only
other alternative would be to rename every .xml file with
escaped characters in their name upon installation, depending
on the behavior of the installed libcurl (on standalone anyway).
However, if you add to that in the future curl_escape has to
be replaced with curl_easy_escape, which is far from easy to
call as it requires a CURL to be passed for which LL invented
a wrapper in libllmessage, but did hide that (Curl::Easy is
only defined in a .cpp file), then we're better of just using
our own function, which I named LLWeb::curlEscape.
This commit is contained in:
Aleric Inglewood
2011-05-02 20:15:50 +02:00
parent 094587aefd
commit 1ced64e0b4
8 changed files with 36 additions and 63 deletions

View File

@@ -51,6 +51,9 @@ public:
// Loads unescaped url in external browser.
static void loadURLExternal(const std::string& url);
// Behaves like the old curl_escape.
static std::string curlEscape(const std::string& url);
// Returns escaped (eg, " " to "%20") url
static std::string escapeURL(const std::string& url);