From 67020c98cc77294675902bdd50cd6642b7a878f2 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 16 Jan 2016 01:13:22 -0800 Subject: [PATCH 1/3] Fix "Array to string conversion/Undefined variable" error in PHP 7 --- tests/PHPCurlClass/server.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/PHPCurlClass/server.php b/tests/PHPCurlClass/server.php index ebbb74f..c11cc0e 100644 --- a/tests/PHPCurlClass/server.php +++ b/tests/PHPCurlClass/server.php @@ -248,17 +248,17 @@ if ($test == 'http_basic_auth') { header('Content-Type: text/plain'); $data_mapping = array( - 'cookie' => '_COOKIE', - 'delete' => '_GET', - 'get' => '_GET', - 'patch' => '_PATCH', - 'post' => '_POST', - 'put' => '_PUT', - 'server' => '_SERVER', + 'cookie' => $_COOKIE, + 'delete' => $_GET, + 'get' => $_GET, + 'patch' => $_PATCH, + 'post' => $_POST, + 'put' => $_PUT, + 'server' => $_SERVER, ); if (!empty($test)) { - $data = $$data_mapping[$test]; + $data = $data_mapping[$test]; $value = isset($data[$key]) ? $data[$key] : ''; echo $value; } From 9372c4af3bd8fbc5e81fa3bd87a9086b1093419f Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 16 Jan 2016 02:29:07 -0800 Subject: [PATCH 2/3] Fix PUT with empty POST data returning inode/x-empty instead of image/png --- src/Curl/Curl.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index ff215d3..6cdb3f0 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -544,7 +544,9 @@ class Curl if (empty($this->options[CURLOPT_INFILE]) && empty($this->options[CURLOPT_INFILESIZE])) { $this->setHeader('Content-Length', strlen($put_data)); } - $this->setOpt(CURLOPT_POSTFIELDS, $put_data); + if (!empty($put_data)) { + $this->setOpt(CURLOPT_POSTFIELDS, $put_data); + } return $this->exec(); } From 238ce588102d24dd04c0c4cb9701103339886f82 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 16 Jan 2016 02:31:11 -0800 Subject: [PATCH 3/3] Include PHP 7 in continuous integration tests --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5e046cc..77629d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,13 @@ php: - 5.4 - 5.5 - 5.6 + - 7.0 - hhvm - nightly matrix: allow_failures: + - php: 7.0 - php: nightly before_script: