Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joining query with empty original variable in query #43

Closed
blaaat opened this issue Jun 3, 2016 · 2 comments
Closed

Joining query with empty original variable in query #43

blaaat opened this issue Jun 3, 2016 · 2 comments

Comments

@blaaat
Copy link

blaaat commented Jun 3, 2016

First of all, i'm not sure i'm running the latest version, but couldn't find anything about this in the changelogs.

When you join query and the original parameter value is empty, it's removed from the modifies query string.

Example:

$hurl = new http\url("http://www.google.com/?a");

$hurl = $hurl->mod(array(
'query' => 'b=3'),
http\url::JOIN_QUERY
);
$url = $hurl->toString();

Output: http://www.google.com/?b=3
Expected output: http://www.google.com/?a&b=3

@blaaat
Copy link
Author

blaaat commented Jun 3, 2016

This isn't working the other way around either (by adding 'b=') without value.

@blaaat blaaat changed the title Joining query_path with empty original variable in query Joining query with empty original variable in query Jun 3, 2016
@m6w6
Copy link
Owner

m6w6 commented Jun 6, 2016

If you're running on PHP5, you can try the tip of https://github.com/m6w6/ext-http/tree/v2.6.x to verify a possible fix.

@m6w6 m6w6 closed this as completed Jun 21, 2016
@m6w6 m6w6 removed the in progress label Jun 21, 2016
m6w6 added a commit that referenced this issue Oct 4, 2016
+ Added http\Client\Curl\User interface for userland event loops
+ Added http\Url::IGNORE_ERRORS, http\Url::SILENT_ERRORS and
http\Url::STDFLAGS
+ Added http\Client::setDebug(callable $debug)
+ Added http\Client\Curl\FEATURES constants and namespace
+ Added http\Client\Curl\VERSIONS constants and namespace
+ Added share_cookies and share_ssl (libcurl >= 7.23.0) options to
http\Client::configure()
+ http\Client uses curl_share handles to properly share cookies and
SSL/TLS sessions between requests
+ Improved configure checks for default CA bundles
+ Improved negotiation precision
* Fixed regression introduced by http\Params::PARSE_RFC5987: negotiation
using the params parser would receive param keys without the trailing
asterisk, stripped by http\Params::PARSE_RFC5987.
* Fix gh-issue #50: http\Client::dequeue() within
http\Client::setDebug() causes segfault (Mike, Maik Wagner)
* Fix gh-issue #47: http\Url: Null pointer deref in sanitize_value()
(Mike, @rc0r)
* Fix gh-issue #45: HTTP/2 response message parsing broken with libcurl
>= 7.49.1 (Mike)
* Fix gh-issue #43: Joining query with empty original variable in query
(Mike, Sander Backus)
* Fix gh-issue #42: fatal error when using punycode in URLs (Mike,
Sebastian Thielen)
* Fix gh-issue #41: Use curl_version_info_data.features when
initializing options (Mike)
* Fix gh-issue #40: determinde the SSL backend used by curl at runtime
(Mike, @rcanavan)
* Fix gh-issue #39: Notice: http\Client::enqueue(): Could not set option
proxy_service_name (Mike, @rcanavan)
* Fix gh-issue #38: Persistent curl handles: error code not properly
reset (Mike, @afflerbach)
* Fix gh-issue #36: Unexpected cookies sent if persistent_handle_id is
used (Mike, @rcanavan, @afflerbach)
* Fix gh-issue #34: allow setting multiple headers with the same name
(Mike, @rcanavan)
* Fix gh-issue #33: allow setting prodyhost request option to NULL
(Mike, @rcanavan)
* Fix gh-issue #31: add/improve configure checks for default CA
bundle/path (Mike, @rcanavan)

Changes from beta1:
* Fixed PHP-5.3 compatibility
* Fixed recursive calls to the event loop dispatcher

Changes from beta2:
* Fix bug #73055: crash in http\QueryString (Mike, @rc0r)
(CVE-2016-7398)
* Fix bug #73185: Buffer overflow in HTTP parse_hostinfo() (Mike, @rc0r)
* Fix HTTP/2 version parser for older libcurl versions (Mike)
m6w6 added a commit that referenced this issue Oct 4, 2016
+ Added http\Client\Curl\User interface for userland event loops
+ Added http\Url::IGNORE_ERRORS, http\Url::SILENT_ERRORS and
http\Url::STDFLAGS
+ Added http\Client::setDebug(callable $debug)
+ Added http\Client\Curl\FEATURES constants and namespace
+ Added http\Client\Curl\VERSIONS constants and namespace
+ Added share_cookies and share_ssl (libcurl >= 7.23.0) options to
http\Client::configure()
+ http\Client uses curl_share handles to properly share cookies and
SSL/TLS sessions between requests
+ Improved configure checks for default CA bundles
+ Improved negotiation precision
* Fixed regression introduced by http\Params::PARSE_RFC5987: negotiation
using the params parser would receive param keys without the trailing
asterisk, stripped by http\Params::PARSE_RFC5987.
* Fix gh-issue #50: http\Client::dequeue() within
http\Client::setDebug() causes segfault (Mike, Maik Wagner)
* Fix gh-issue #47: http\Url: Null pointer deref in sanitize_value()
(Mike, @rc0r)
* Fix gh-issue #45: HTTP/2 response message parsing broken with libcurl
>= 7.49.1 (Mike)
* Fix gh-issue #43: Joining query with empty original variable in query
(Mike, Sander Backus)
* Fix gh-issue #42: fatal error when using punycode in URLs (Mike,
Sebastian Thielen)
* Fix gh-issue #41: Use curl_version_info_data.features when
initializing options (Mike)
* Fix gh-issue #40: determinde the SSL backend used by curl at runtime
(Mike, @rcanavan)
* Fix gh-issue #39: Notice: http\Client::enqueue(): Could not set option
proxy_service_name (Mike, @rcanavan)
* Fix gh-issue #38: Persistent curl handles: error code not properly
reset (Mike, @afflerbach)
* Fix gh-issue #36: Unexpected cookies sent if persistent_handle_id is
used (Mike, @rcanavan, @afflerbach)
* Fix gh-issue #34: allow setting multiple headers with the same name
(Mike, @rcanavan)
* Fix gh-issue #33: allow setting prodyhost request option to NULL
(Mike, @rcanavan)
* Fix gh-issue #31: add/improve configure checks for default CA
bundle/path (Mike, @rcanavan)

Changes from beta1:
* Fixed recursive calls to the event loop dispatcher

Changes from beta2:
+ Improved configure checks for IDNA libraries (added
--with-http-libicu-dir, --with-http-libidnkit{,2}-dir,
--with-http-libidn2-dir)
* Fix bug #73055: crash in http\QueryString (Mike, @rc0r)
(CVE-2016-7398)
* Fix bug #73185: Buffer overflow in HTTP parse_hostinfo() (Mike, @rc0r)
* Fix HTTP/2 version parser for older libcurl versions (Mike)
* Fix gh-issue #52: Underscores in host names: libidn Failed to parse
IDN (Mike, @canavan)
m6w6 added a commit that referenced this issue Dec 12, 2016
+ Added http\Client\Curl\User interface for userland event loops
+ Added http\Url::IGNORE_ERRORS, http\Url::SILENT_ERRORS and
  http\Url::STDFLAGS
+ Added http\Client::setDebug(callable $debug)
+ Added http\Client\Curl\FEATURES constants and namespace
+ Added http\Client\Curl\VERSIONS constants and namespace
+ Added share_cookies and share_ssl (libcurl >= 7.23.0) options to
  http\Client::configure()
+ http\Client uses curl_share handles to properly share cookies and
  SSL/TLS sessions between requests
+ Improved configure checks for default CA bundles
+ Improved negotiation precision
* Fixed regression introduced by http\Params::PARSE_RFC5987: negotiation
  using the params parser would receive param keys without the trailing
  asterisk, stripped by http\Params::PARSE_RFC5987.
* Fix gh-issue #50: http\Client::dequeue() within
  http\Client::setDebug() causes segfault (Mike, Maik Wagner)
* Fix gh-issue #47: http\Url: Null pointer deref in sanitize_value()
  (Mike, @rc0r)
* Fix gh-issue #45: HTTP/2 response message parsing broken with
  libcurl >= 7.49.1 (Mike)
* Fix gh-issue #43: Joining query with empty original variable in query
  (Mike, Sander Backus)
* Fix gh-issue #42: fatal error when using punycode in URLs
  (Mike, Sebastian Thielen)
* Fix gh-issue #41: Use curl_version_info_data.features when
  initializing options (Mike)
* Fix gh-issue #40: determinde the SSL backend used by curl at runtime
  (Mike, @rcanavan)
* Fix gh-issue #39: Notice: http\Client::enqueue(): Could not set option
  proxy_service_name (Mike, @rcanavan)
* Fix gh-issue #38: Persistent curl handles: error code not properly
  reset (Mike, @afflerbach)
* Fix gh-issue #36: Unexpected cookies sent if persistent_handle_id is
  used (Mike, @rcanavan, @afflerbach)
* Fix gh-issue #34: allow setting multiple headers with the same name
  (Mike, @rcanavan)
* Fix gh-issue #33: allow setting prodyhost request option to NULL
  (Mike, @rcanavan)
* Fix gh-issue #31: add/improve configure checks for default
  CA bundle/path (Mike, @rcanavan)

Changes from beta1:
* Fixed PHP-5.3 compatibility
* Fixed recursive calls to the event loop dispatcher

Changes from beta2:
* Fix bug #73055: crash in http\QueryString (Mike, @rc0r)
  (CVE-2016-7398)
* Fix bug #73185: Buffer overflow in HTTP parse_hostinfo() (Mike, @rc0r)
  (CVE-2016-7961)
* Fix HTTP/2 version parser for older libcurl versions (Mike)
m6w6 added a commit that referenced this issue Dec 12, 2016
+ Added http\Client\Curl\User interface for userland event loops
+ Added http\Url::IGNORE_ERRORS, http\Url::SILENT_ERRORS and
  http\Url::STDFLAGS
+ Added http\Client::setDebug(callable $debug)
+ Added http\Client\Curl\FEATURES constants and namespace
+ Added http\Client\Curl\VERSIONS constants and namespace
+ Added share_cookies and share_ssl (libcurl >= 7.23.0) options to
  http\Client::configure()
+ http\Client uses curl_share handles to properly share cookies and
  SSL/TLS sessions between requests
+ Improved configure checks for default CA bundles
+ Improved negotiation precision
* Fixed regression introduced by http\Params::PARSE_RFC5987: negotiation
  using the params parser would receive param keys without the trailing
  asterisk, stripped by http\Params::PARSE_RFC5987.
* Fix gh-issue #50: http\Client::dequeue() within
  http\Client::setDebug() causes segfault (Mike, Maik Wagner)
* Fix gh-issue #47: http\Url: Null pointer deref in sanitize_value()
  (Mike, @rc0r)
* Fix gh-issue #45: HTTP/2 response message parsing broken with
  libcurl >= 7.49.1 (Mike)
* Fix gh-issue #43: Joining query with empty original variable in query
  (Mike, Sander Backus)
* Fix gh-issue #42: fatal error when using punycode in URLs
  (Mike, Sebastian Thielen)
* Fix gh-issue #41: Use curl_version_info_data.features when
  initializing options (Mike)
* Fix gh-issue #40: determinde the SSL backend used by curl at runtime
  (Mike, @rcanavan)
* Fix gh-issue #39: Notice: http\Client::enqueue(): Could not set option
  proxy_service_name (Mike, @rcanavan)
* Fix gh-issue #38: Persistent curl handles: error code not properly
  reset (Mike, @afflerbach)
* Fix gh-issue #36: Unexpected cookies sent if persistent_handle_id is
  used (Mike, @rcanavan, @afflerbach)
* Fix gh-issue #34: allow setting multiple headers with the same name
  (Mike, @rcanavan)
* Fix gh-issue #33: allow setting prodyhost request option to NULL
  (Mike, @rcanavan)
* Fix gh-issue #31: add/improve configure checks for default
  CA bundle/path (Mike, @rcanavan)

Changes from beta1:
* Fixed recursive calls to the event loop dispatcher

Changes from beta2:
+ Improved configure checks for IDNA libraries (added
  --with-http-libicu-dir, --with-http-libidnkit{,2}-dir,
  --with-http-libidn2-dir)
* Fix bug #73055: crash in http\QueryString (Mike, @rc0r)
  (CVE-2016-7398)
* Fix bug #73185: Buffer overflow in HTTP parse_hostinfo() (Mike, @rc0r)
  (CVE-2016-7961)
* Fix HTTP/2 version parser for older libcurl versions (Mike)
* Fix gh-issue #52: Underscores in host names: libidn Failed to parse
  IDN (Mike, @canavan)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants