[asterisk-commits] tilghman: trunk r301008 - /trunk/funcs/func_curl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 7 18:23:57 UTC 2011


Author: tilghman
Date: Fri Jan  7 12:23:52 2011
New Revision: 301008

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=301008
Log:
Oops, missed the actual decoding part.

(closes issue #18046)
 Reported by: wdoekes

Modified:
    trunk/funcs/func_curl.c

Modified: trunk/funcs/func_curl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/funcs/func_curl.c?view=diff&rev=301008&r1=301007&r2=301008
==============================================================================
--- trunk/funcs/func_curl.c (original)
+++ trunk/funcs/func_curl.c Fri Jan  7 12:23:52 2011
@@ -654,6 +654,22 @@
 				if (!piece) {
 					piece = "";
 				}
+				/* Do this before the decode, because if something has encoded
+				 * a literal plus-sign, we don't want to translate that to a
+				 * space. */
+				if (hashcompat == HASHCOMPAT_LEGACY) {
+					int i;
+					for (i = 0; name[i]; i++) {
+						if (name[i] == '+') {
+							name[i] = ' ';
+						}
+					}
+					for (i = 0; piece[i]; i++) {
+						if (piece[i] == '+') {
+							piece[i] = ' ';
+						}
+					}
+				}
 				ast_uri_decode(piece);
 				ast_uri_decode(name);
 				ast_str_append(&fields, 0, "%s%s", rowcount ? "," : "", name);




More information about the asterisk-commits mailing list