summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-04-16 19:25:13 +0200
committerAnatol Belski <ab@php.net>2016-04-16 19:25:13 +0200
commite015faaf8f022f6338c0254ef2fd617f29c94c84 (patch)
tree6d371db288bbce5bf89e4c3bee46d7bd131af16c /ext
parent8c5861e6c650a2d6b8044151b2f71b6b6fcc024c (diff)
parent02766d0180e901d4fc6dc7a06fb09867dec40c1e (diff)
downloadphp-git-e015faaf8f022f6338c0254ef2fd617f29c94c84.tar.gz
Merge branch 'PHP-7.0'
* PHP-7.0: Adds new curl option CURLOPT_SSL_VERIFYSTATUS to enable OCSP verification Add test for bug #72028
Diffstat (limited to 'ext')
-rw-r--r--ext/curl/interface.c6
-rw-r--r--ext/pgsql/tests/bug72028.phpt52
2 files changed, 58 insertions, 0 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index ca899af843..fb280a46ea 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -719,6 +719,9 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_SSL_CIPHER_LIST);
REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYHOST);
REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYPEER);
+#if LIBCURL_VERSION_NUM >= 0x072900 /* 7.41.0 */
+ REGISTER_CURL_CONSTANT(CURLOPT_SSL_VERIFYSTATUS);
+#endif
REGISTER_CURL_CONSTANT(CURLOPT_STDERR);
REGISTER_CURL_CONSTANT(CURLOPT_TELNETOPTIONS);
REGISTER_CURL_CONSTANT(CURLOPT_TIMECONDITION);
@@ -2066,6 +2069,9 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
case CURLOPT_RESUME_FROM:
case CURLOPT_SSLVERSION:
case CURLOPT_SSL_VERIFYPEER:
+#if LIBCURL_VERSION_NUM >= 0x072900 /* 7.41.0 */
+ case CURLOPT_SSL_VERIFYSTATUS:
+#endif
case CURLOPT_TIMECONDITION:
case CURLOPT_TIMEOUT:
case CURLOPT_TIMEVALUE:
diff --git a/ext/pgsql/tests/bug72028.phpt b/ext/pgsql/tests/bug72028.phpt
new file mode 100644
index 0000000000..217a03abc7
--- /dev/null
+++ b/ext/pgsql/tests/bug72028.phpt
@@ -0,0 +1,52 @@
+--TEST--
+Bug #72028 pg_query_params(): NULL converts to empty string
+--SKIPIF--
+<?php include("skipif.inc"); ?>
+--FILE--
+<?php
+// create test table
+
+include('config.inc');
+
+$conn = pg_connect($conn_str);
+
+$table = "bug72028_" . md5(uniqid(time()));
+
+pg_query("CREATE TABLE $table (value TEXT, details TEXT);");
+
+$sql = "INSERT INTO $table (value, details) VALUES ($1, $2)";
+
+$params = array(null, "insert before looping with a reference");
+$result = pg_query_params($conn, $sql, $params);
+
+$params2 = array(null, "insert after looping with a reference");
+foreach ($params2 as &$p) {
+ // doing nothing
+}
+unset($p);
+
+$result = pg_query_params($conn, $sql, $params2);
+
+$r = pg_query("SELECT * FROM $table");
+while (false !== ($i = pg_fetch_assoc($r))) {
+ var_dump($i);
+}
+
+pg_query("DROP TABLE $table");
+
+?>
+==DONE==
+--EXPECT--
+array(2) {
+ ["value"]=>
+ NULL
+ ["details"]=>
+ string(38) "insert before looping with a reference"
+}
+array(2) {
+ ["value"]=>
+ NULL
+ ["details"]=>
+ string(37) "insert after looping with a reference"
+}
+==DONE==