Skip to content

Instantly share code, notes, and snippets.

@neverything
Last active October 11, 2015 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neverything/3903478 to your computer and use it in GitHub Desktop.
Save neverything/3903478 to your computer and use it in GitHub Desktop.
Nasty fix to pass fixed cookie value in WP_Http_Cookie
<?php
//...
// Replace space with + from cookie value
// because WP_Http_Cookie does urldecode( value )
// which is fucking wrong.
$response['cookies'][0]->value = str_replace(' ', '+', $response['cookies'][0]->value);
// Set cookies for the second request
$this->cookies = $response['cookies'];
//...
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment