From 92ad5930af4f657a3f863ad765dd3fa3f75aa0e4 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Tue, 4 Apr 2017 13:35:18 +0200 Subject: [PATCH] Fixed issue #63 Use urldecode instead of raw_urldecode in http_params --- src/php_http_params.c | 2 +- tests/gh-issue63.phpt | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 tests/gh-issue63.phpt diff --git a/src/php_http_params.c b/src/php_http_params.c index 92cc558..3ec71b1 100644 --- a/src/php_http_params.c +++ b/src/php_http_params.c @@ -118,7 +118,7 @@ static inline void prepare_escaped(zval *zv) static inline void sanitize_urlencoded(zval *zv) { - Z_STRLEN_P(zv) = php_raw_url_decode(Z_STRVAL_P(zv), Z_STRLEN_P(zv)); + Z_STRLEN_P(zv) = php_url_decode(Z_STRVAL_P(zv), Z_STRLEN_P(zv)); } static inline void prepare_urlencoded(zval *zv) diff --git a/tests/gh-issue63.phpt b/tests/gh-issue63.phpt new file mode 100644 index 0000000..e03b32f --- /dev/null +++ b/tests/gh-issue63.phpt @@ -0,0 +1,27 @@ +--TEST-- +segfault with Client::setDebug and Client::dequeue() +--SKIPIF-- + +--FILE-- + 'bar']; +$parts['query'] = new QueryString($query); +echo (new Url($url, null, Url::STDFLAGS))->mod($parts)->toString(); + +?> + +===DONE=== +--EXPECTF-- +Test +http://example.com/?param=has%20spaces&foo=bar +===DONE=== -- 2.30.2