summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-10-17 10:13:08 +0200
committerAnatol Belski <ab@php.net>2014-10-17 10:13:08 +0200
commit2942a4aa451452c354b2eb2e14f583978388a61a (patch)
tree4afe9f92c6e54a0349417cf6dce9171d9a8535d5 /ext
parentaac7b1db7c9df59ffb0860de7692c653719cf4d0 (diff)
parent1f6bd981433cdfc90238a95aa7339d72e7f2bc01 (diff)
downloadphp-git-2942a4aa451452c354b2eb2e14f583978388a61a.tar.gz
Merge remote-tracking branch 'origin/master' into native-tls
* origin/master: check for zlib headers as well as lib for mysqlnd a realpath cache key can be int or float, catching this TLS 1.0, 1.1 and 1.2 Curl constants - bug #68247 Micro optimizations for isset/empty Micro optimization for zend_hash_next_index_insert_new() Fix array_keys() on $GLOBALS Fix procedural finfo calls in methods Conflicts: ext/mysqlnd/config.w32
Diffstat (limited to 'ext')
-rw-r--r--ext/curl/interface.c6
-rw-r--r--ext/fileinfo/fileinfo.c2
-rw-r--r--ext/fileinfo/tests/precedural_finfo_in_method.phpt18
-rw-r--r--ext/mysqlnd/config.w327
-rw-r--r--ext/standard/array.c2
-rw-r--r--ext/standard/tests/array/array_keys_on_GLOBALS.phpt12
-rw-r--r--ext/standard/tests/file/realpath_cache_win32.phpt2
7 files changed, 44 insertions, 5 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index affcd02d39..af1ccdd4cf 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -1201,6 +1201,12 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLSSLOPT_ALLOW_BEAST);
#endif
+#if LIBCURL_VERSION_NUM >= 0x072200 /* Available since 7.34.0 */
+ REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_0);
+ REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_1);
+ REGISTER_CURL_CONSTANT(CURL_SSLVERSION_TLSv1_2);
+#endif
+
#if CURLOPT_FTPASCII != 0
REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII);
#endif
diff --git a/ext/fileinfo/fileinfo.c b/ext/fileinfo/fileinfo.c
index f365b38573..6879926eca 100644
--- a/ext/fileinfo/fileinfo.c
+++ b/ext/fileinfo/fileinfo.c
@@ -57,7 +57,7 @@ typedef struct _finfo_object {
} finfo_object;
#define FILEINFO_DECLARE_INIT_OBJECT(object) \
- zval *object = getThis();
+ zval *object = ZEND_IS_METHOD_CALL() ? getThis() : NULL;
static inline finfo_object *php_finfo_fetch_object(zend_object *obj) {
return (finfo_object *)((char*)(obj) - XtOffsetOf(finfo_object, zo));
diff --git a/ext/fileinfo/tests/precedural_finfo_in_method.phpt b/ext/fileinfo/tests/precedural_finfo_in_method.phpt
new file mode 100644
index 0000000000..8c30b8a197
--- /dev/null
+++ b/ext/fileinfo/tests/precedural_finfo_in_method.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Using procedural finfo API in a method
+--FILE--
+<?php
+
+class Test {
+ public function method() {
+ $finfo = finfo_open(FILEINFO_MIME);
+ var_dump(finfo_file($finfo, __FILE__));
+ }
+}
+
+$test = new Test;
+$test->method();
+
+?>
+--EXPECT--
+string(28) "text/plain; charset=us-ascii"
diff --git a/ext/mysqlnd/config.w32 b/ext/mysqlnd/config.w32
index 477ce424ce..ff102310dd 100644
--- a/ext/mysqlnd/config.w32
+++ b/ext/mysqlnd/config.w32
@@ -26,8 +26,11 @@ if (PHP_MYSQLND != "no") {
"mysqlnd_wireprotocol.c " +
"php_mysqlnd.c ";
EXTENSION("mysqlnd", mysqlnd_source, false, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
- if (((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "mysqlnd", PHP_MYSQLND))) ||
- (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "mysqlnd", PHP_MYSQLND)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
+ if ((((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib;zlib.lib", "mysqlnd", PHP_MYSQLND))) ||
+ (PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "mysqlnd", PHP_MYSQLND)) ||
+ (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED))) &&
+ CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" + php_usual_include_suspects)
+ )
{
AC_DEFINE("MYSQLND_COMPRESSION_ENABLED", 1, "Compression support");
AC_DEFINE("MYSQLND_SSL_SUPPORTED", 1, "SSL support");
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 7b49b2fd13..7d8e4d0efe 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -2597,7 +2597,7 @@ PHP_FUNCTION(array_keys)
add_key = 1;
/* Go through input array and add keys to the return array */
- ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(input), num_idx, str_idx, entry) {
+ ZEND_HASH_FOREACH_KEY_VAL_IND(Z_ARRVAL_P(input), num_idx, str_idx, entry) {
if (search_value != NULL) {
is_equal_func(&res, search_value, entry TSRMLS_CC);
add_key = zval_is_true(&res);
diff --git a/ext/standard/tests/array/array_keys_on_GLOBALS.phpt b/ext/standard/tests/array/array_keys_on_GLOBALS.phpt
new file mode 100644
index 0000000000..1d14ff4d53
--- /dev/null
+++ b/ext/standard/tests/array/array_keys_on_GLOBALS.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Using array_keys() on $GLOBALS
+--FILE--
+<?php
+
+$foo = 'bar';
+unset($foo);
+var_dump(in_array('foo', array_keys($GLOBALS)));
+
+?>
+--EXPECT--
+bool(false)
diff --git a/ext/standard/tests/file/realpath_cache_win32.phpt b/ext/standard/tests/file/realpath_cache_win32.phpt
index a4c663f6d1..e74a6565a7 100644
--- a/ext/standard/tests/file/realpath_cache_win32.phpt
+++ b/ext/standard/tests/file/realpath_cache_win32.phpt
@@ -19,7 +19,7 @@ echo "Done\n";
int(%d)
array(8) {
["key"]=>
- %s(%d)
+ %s(%d%s)
["is_dir"]=>
bool(true)
["realpath"]=>