On 2017-08-12 20:07, I wrote:
I've attached a patch, but it would be better to switch to
HTTP/Request2, I think.
The previous patch removed one "&" too much.
Fixed patch attached.
-thh
--- HTTP_Request-1.4.4/Request.php 2017-08-12 19:39:37.542731105 +0200
+++ HTTP_Request-1.4.4/Request.php.NEW 2017-08-13 12:29:21.912534035 +0200
@@ -409,7 +409,7 @@
*/
function setURL($url)
{
- $this->_url = &new Net_URL($url, $this->_useBrackets);
+ $this->_url = new Net_URL($url, $this->_useBrackets);
if (!empty($this->_url->user) || !empty($this->_url->pass)) {
$this->setBasicAuth($this->_url->user, $this->_url->pass);
@@ -733,7 +733,7 @@
$err = null;
} else {
$this->_notify('connect');
- $this->_sock =& new Net_Socket();
+ $this->_sock = new Net_Socket();
$err = $this->_sock->connect($host, $port, null, $this->_timeout, $this->_socketOptions);
}
PEAR::isError($err) or $err = $this->_sock->write($this->_buildRequest());
@@ -746,7 +746,7 @@
$this->_notify('sentRequest');
// Read the response
- $this->_response = &new HTTP_Response($this->_sock, $this->_listeners);
+ $this->_response = new HTTP_Response($this->_sock, $this->_listeners);
$err = $this->_response->process(
$this->_saveBody && $saveBody,
HTTP_REQUEST_METHOD_HEAD != $this->_method
@@ -791,7 +791,7 @@
// Absolute URL
if (preg_match('/^https?:\/\//i', $redirect)) {
- $this->_url = &new Net_URL($redirect);
+ $this->_url = new Net_URL($redirect);
$this->addHeader('Host', $this->_generateHostHeader());
// Absolute path
} elseif ($redirect{0} == '/') {