Search
j0ke.net Open Build Service
>
Projects
>
Apache
:
Modules
>
apache2-mod_auth_openid
> mod_auth_openid-0.6-quoteplus.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File mod_auth_openid-0.6-quoteplus.diff of Package apache2-mod_auth_openid
From 9b59ed2d7ca76507430f538ec10f0c71ba309f77 Mon Sep 17 00:00:00 2001 From: Brian Muller <brian.muller@livingsocial.com> Date: Sun, 2 Jan 2011 18:47:43 +0000 Subject: [PATCH] Fix for #10 - curl_unescape deprecated / libcurl doesn't unescape '+' as a space --- http_helpers.cpp | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/http_helpers.cpp b/http_helpers.cpp index 539155d..a78f740 100644 --- a/http_helpers.cpp +++ b/http_helpers.cpp @@ -226,11 +226,20 @@ namespace modauthopenid { }; string url_decode(const string& str) { - char * t = curl_unescape(str.c_str(),str.length()); + // if +'s aren't replaced with %20's then curl won't unescape to spaces propperly + string url = str_replace("+", "%20", str); + + CURL *curl = curl_easy_init(); + if(!curl) + throw failed_conversion(OPKELE_CP_ "failed to curl_easy_init()"); + + char * t = curl_easy_unescape(curl, url.c_str(), url.length(), NULL); if(!t) throw failed_conversion(OPKELE_CP_ "failed to curl_unescape()"); + string rv(t); curl_free(t); + curl_easy_cleanup(curl); return rv; }; -- 1.7.3.4