summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2014-10-16 21:27:49 -0700
committerRasmus Lerdorf <rasmus@php.net>2014-10-16 21:27:49 -0700
commit0d27b3ea698dbed6b1235f01d82984567aa2b569 (patch)
tree26e4a71225eceecd27433508c6b8b4dafea94541
parent03797a73b25996315b6c6ce606a9d8724439699e (diff)
parenta3beb42ded9d1c016c7f14b66ce6008309b506ec (diff)
downloadphp-git-0d27b3ea698dbed6b1235f01d82984567aa2b569.tar.gz
Merge branch 'PHP-5.6' of git.php.net:php-src into PHP-5.6
* 'PHP-5.6' of git.php.net:php-src: (129 commits) NEWS cleanup NEWS removing the NEWS entry as we had to revert this fix for now Revert "Merge branch 'PHP-5.5' into PHP-5.6" Revert "fix TS build" Revert "Merge branch 'PHP-5.4' into PHP-5.5" Revert "Bug #67965: Fix blocking behavior in non-blocking crypto streams" Revert "Bug #41631: Fix regression from first attempt (6569db8)" NEWS Fixed Bug #65171 imagescale() fails Fixed bug #68234 Revert "Bug #41631: Observe socket read timeouts in SSL streams" PHP-5.6.3 is next update NEWS, 5.6.2 will be a security-only release Fix return code (merges are hard :( ) Fix bug #68113 (Heap corruption in exif_thumbnail()) Fix bug #68089 - do not accept options with embedded \0 Fixed bug #68044: Integer overflow in unserialize() (32-bits only) Fix bug #68027 - fix date parsing in XMLRPC lib Fix bug #68113 (Heap corruption in exif_thumbnail()) ...
-rw-r--r--.gitignore1
-rw-r--r--EXTENSIONS12
-rw-r--r--NEWS85
-rw-r--r--UPGRADING2
-rw-r--r--Zend/tests/bug67633.phpt44
-rw-r--r--Zend/tests/bug67985.phpt16
-rw-r--r--Zend/tests/bug68118.phpt21
-rw-r--r--Zend/zend.c2
-rw-r--r--Zend/zend_API.c2
-rw-r--r--Zend/zend_API.h2
-rw-r--r--Zend/zend_compile.c9
-rw-r--r--Zend/zend_extensions.h2
-rw-r--r--Zend/zend_object_handlers.c9
-rw-r--r--Zend/zend_variables.c1
-rw-r--r--configure.in32
-rw-r--r--ext/curl/interface.c5
-rw-r--r--ext/curl/tests/bug68089.phpt18
-rw-r--r--ext/curl/tests/check_win_config.phpt2
-rw-r--r--ext/date/lib/timezonedb.h1218
-rw-r--r--ext/date/php_date.c8
-rw-r--r--ext/date/tests/68062.phpt13
-rw-r--r--ext/date/tests/DateTimeZone_getOffset_variation1.phpt56
-rw-r--r--ext/date/tests/timezone_offset_get_error.phpt6
-rw-r--r--ext/date/tests/timezone_offset_get_variation2.phpt56
-rw-r--r--ext/dom/dom_properties.h2
-rw-r--r--ext/dom/php_dom.c55
-rw-r--r--ext/dom/php_dom.h2
-rw-r--r--ext/dom/tests/bug67949.phpt87
-rw-r--r--ext/exif/exif.c4
-rwxr-xr-xext/exif/tests/bug68113.jpgbin0 -> 368 bytes
-rw-r--r--ext/exif/tests/bug68113.phpt17
-rwxr-xr-xext/ext_skel4
-rw-r--r--ext/fileinfo/libmagic/apprentice.c2
-rw-r--r--ext/gd/gd.c16
-rw-r--r--ext/gd/tests/bug48801_1.phpt9
-rw-r--r--ext/gd/tests/bug48801_2.phpt25
-rw-r--r--ext/gmp/gmp.c122
-rw-r--r--ext/gmp/php_gmp.h2
-rw-r--r--ext/gmp/tests/gmp_random_bits.phpt45
-rw-r--r--ext/gmp/tests/gmp_random_range.phpt81
-rw-r--r--ext/ldap/ldap.c23
-rw-r--r--ext/mysqlnd/config9.m47
-rw-r--r--ext/mysqlnd/mysqlnd_ps_codec.c12
-rw-r--r--ext/odbc/php_odbc.c5
-rw-r--r--ext/odbc/tests/bug68087.phpt57
-rw-r--r--ext/opcache/Optimizer/pass1_5.c6
-rw-r--r--ext/openssl/config0.m46
-rw-r--r--ext/openssl/tests/bug65729.pem56
-rw-r--r--ext/openssl/xp_ssl.c68
-rw-r--r--ext/reflection/php_reflection.c27
-rw-r--r--ext/session/mod_user_class.c2
-rw-r--r--ext/session/tests/bug67972.phpt10
-rw-r--r--ext/spl/spl_engine.h35
-rw-r--r--ext/spl/spl_iterators.c57
-rw-r--r--ext/spl/tests/bug68128.phpt91
-rw-r--r--ext/spl/tests/iterator_048.phpt5
-rw-r--r--ext/spl/tests/iterator_050.phpt4
-rw-r--r--ext/spl/tests/iterator_052.phpt146
-rw-r--r--ext/spl/tests/iterator_053.phpt125
-rw-r--r--ext/spl/tests/iterator_054.phpt2
-rw-r--r--ext/standard/image.c6
-rw-r--r--ext/standard/pack.c154
-rw-r--r--ext/standard/tests/serialize/bug68044.phpt12
-rw-r--r--ext/standard/tests/streams/proc_open_bug51800.phpt95
-rw-r--r--ext/standard/tests/streams/proc_open_bug51800_right.phpt78
-rw-r--r--ext/standard/tests/streams/proc_open_bug51800_right2.phpt84
-rw-r--r--ext/standard/tests/streams/proc_open_bug60120.phpt71
-rw-r--r--ext/standard/tests/streams/proc_open_bug64438.phpt70
-rw-r--r--ext/standard/tests/strings/pack64.phpt115
-rw-r--r--ext/standard/tests/strings/pack64_32.phpt44
-rw-r--r--ext/standard/tests/strings/setlocale_variation2.phpt7
-rw-r--r--ext/standard/tests/strings/url_t.phpt212
-rw-r--r--ext/standard/tests/url/parse_url_basic_001.phpt8
-rw-r--r--ext/standard/tests/url/parse_url_basic_005.phpt2
-rw-r--r--ext/standard/tests/url/parse_url_basic_006.phpt2
-rw-r--r--ext/standard/url.c12
-rw-r--r--ext/standard/var_unserializer.c4
-rw-r--r--ext/standard/var_unserializer.re2
-rw-r--r--ext/sysvsem/sysvsem.c18
-rw-r--r--ext/sysvsem/tests/nowait.phpt103
-rw-r--r--ext/sysvsem/tests/sysv.phpt4
-rw-r--r--ext/xmlrpc/libxmlrpc/xmlrpc.c13
-rw-r--r--ext/xmlrpc/tests/bug68027.phpt44
-rw-r--r--main/php_streams.h3
-rw-r--r--main/php_variables.c12
-rw-r--r--main/php_version.h6
-rw-r--r--main/streams/plain_wrapper.c28
-rw-r--r--main/streams/streams.c8
-rw-r--r--php.ini-development2
-rw-r--r--php.ini-production2
-rw-r--r--sapi/cgi/fastcgi.c4
-rw-r--r--sapi/cli/tests/016.phpt2
-rw-r--r--sapi/fpm/fpm/fpm_main.c11
-rw-r--r--sapi/fpm/fpm/fpm_sockets.c85
-rw-r--r--sapi/fpm/fpm/fpm_sockets.h6
-rw-r--r--sapi/fpm/php-fpm.conf.in2
-rw-r--r--sapi/fpm/tests/003.phpt53
-rw-r--r--sapi/litespeed/lsapi_main.c6
-rw-r--r--sapi/phpdbg/.travis.yml1
-rw-r--r--sapi/phpdbg/README.md2
-rw-r--r--sapi/phpdbg/phpdbg.c10
101 files changed, 2940 insertions, 1302 deletions
diff --git a/.gitignore b/.gitignore
index b9dd252267..7f4f814050 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,7 @@
*.tgz
*.tar.gz
*.tar.bz2
+*.tar.xz
.FBCIndex
.FBCLockFolder
.deps
diff --git a/EXTENSIONS b/EXTENSIONS
index 61a1688b3c..fd454dfc54 100644
--- a/EXTENSIONS
+++ b/EXTENSIONS
@@ -385,6 +385,12 @@ MAINTENANCE: Maintained
STATUS: Working
SINCE: 4.0.4
-------------------------------------------------------------------------------
+EXTENSION: hash
+PRIMARY MAINTAINER: Sara Golemon <pollita@php.net>, Mike Wallner <mike@php.net>, Anatol Belski <ab@php.net>
+MAINTENANCE: Maintained
+STATUS: Working
+SINCE: 5.1.2
+-------------------------------------------------------------------------------
EXTENSION: iconv
PRIMARY MAINTAINER: Moriyoshi Koizumi <moriyoshi@php.net>
MAINTENANCE: Maintained
@@ -438,6 +444,12 @@ PRIMARY MAINTAINER: Frank M. Kromann
MAINTENANCE: Unknown
STATUS: Experimental
-------------------------------------------------------------------------------
+EXTENSION: opcache
+PRIMARY MAINTAINER: Dmitry Stogov <dmitry@zend.com>, Xinchen Hui <laruence@php.net>
+MAINTENANCE: Maintained
+STATUS: Working
+SINCE: 5.5.0
+-------------------------------------------------------------------------------
EXTENSION: openssl
PRIMARY MAINTAINER: Wez Furlong <wez@php.net>, Pierre-Alain Joye <pajoye@php.net>
MAINTENANCE: Maintained
diff --git a/NEWS b/NEWS
index bec3a30fba..8bd27e2a32 100644
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,71 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+?? ??? 2014, PHP 5.6.3
-?? ??? 2014, PHP 5.6.1
+- Core:
+ . Fixed bug #67739 (Windows 8.1/Server 2012 R2 OS build number reported
+ as 6.2 (instead of 6.3)). (Christian Wenz)
+ . Fixed bug #67633 (A foreach on an array returned from a function not doing
+ copy-on-write). (Nikita)
+ . Fixed bug #51800 (proc_open on Windows hangs forever). (Anatol)
+ . Fixed bug #68118 ($a->foo .= 'test'; can leave $a->foo undefined). (Nikita)
+ . Fixed bug #68129 (parse_url() - incomplete support for empty usernames
+ and passwords) (Tjerk)
+ . Fixed bug #67949 (DOMNodeList elements should be accessible through
+ array notation) (Florian)
+ . Implemented 64-bit format codes for pack() and unpack(). (Leigh)
+
+- Fileinfo:
+ . Fixed bug #66242 (libmagic: don't assume char is signed). (ArdB)
+
+- FPM:
+ . Fixed bug #65641 (PHP-FPM incorrectly defines the SCRIPT_NAME variable
+ when using Apache, mod_proxy-fcgi and ProxyPass). (Remi)
+ . Implemented FR #55508 (listen and listen.allowed_clients should take IPv6
+ addresses). (Robin Gloster)
+
+- GD:
+ . Fixed bug #65171 (imagescale() fails without height param). (Remi)
+
+- GMP:
+ . Implemented gmp_random_range() and gmp_random_bits(). (Leigh)
+
+- Reflection:
+ . Fixed bug #68103 (Duplicate entry in Reflection for class alias). (Remi)
+
+- OpenSSL:
+ . Fixed bug #68074 (Allow to use system cipher list instead of hardcoded
+ value). (Remi)
+
+- Mysqli:
+ . Fixed bug #68114 (linker error on some OS X machines with fixed width
+ decimal support) (Keyur Govande)
+
+- ODBC:
+ . Fixed bug #68087 (ODBC not correctly reading DATE column when preceded by
+ a VARCHAR column) (Keyur Govande)
+
+- SPL:
+ . Fixed bug #68128 (Regression in RecursiveRegexIterator) (Tjerk)
+
+16 Oct 2014, PHP 5.6.2
+
+- Core:
+ . Fixed bug #68044 (Integer overflow in unserialize() (32-bits only)).
+ (CVE-2014-3669) (Stas)
+
+- cURL:
+ . Fixed bug #68089 (NULL byte injection - cURL lib). (Stas)
+
+- EXIF:
+ . Fixed bug #68113 (Heap corruption in exif_thumbnail()). (CVE-2014-3670)
+ (Stas)
+
+- XMLRPC:
+ . Fixed bug #68027 (Global buffer overflow in mkgmtime() function).
+ (CVE-2014-3668) (Stas)
+
+02 Oct 2014, PHP 5.6.1
- Core:
. Implemented FR #38409 (parse_ini_file() looses the type of booleans). (Tjerk)
@@ -10,6 +74,13 @@ PHP NEWS
. Fixed bug #67878 (program_prefix not honoured in man pages). (Remi)
. Fixed bug #67938 (Segfault when extending interface method with variadic).
(Nikita)
+ . Fixed bug #67985 (Incorrect last used array index copied to new array after
+ unset). (Tjerk)
+ . Fixed bug #68088 (New Posthandler Potential Illegal efree() vulnerability).
+ (Mike) (CVE-2014-3622)
+
+- DOM:
+ . Made DOMNode::textContent writeable. (Tjerk)
- Fileinfo:
. Fixed bug #67731 (finfo::file() returns invalid mime type
@@ -32,12 +103,19 @@ PHP NEWS
. Fixed bug #67850 (extension won't build if openssl compiled without SSLv3).
(Daniel Lowrey)
-- DOM:
- . Made DOMNode::textContent writeable. (Tjerk)
+- phpdbg:
+ . Fixed issue krakjoe/phpdbg#111 (compile error without ZEND_SIGNALS). (Bob)
- SOAP:
. Fixed bug #67955 (SoapClient prepends 0-byte to cookie names). (Philip Hofstetter)
+- Session:
+ . Fixed bug #67972 (SessionHandler Invalid memory read create_sid()). (Adam)
+
+- Sysvsem:
+ . Implemented FR #67990 (Add optional nowait argument to sem_acquire).
+ (Matteo)
+
28 Aug 2014, PHP 5.6.0
- Apache2 Handler SAPI:
@@ -63,6 +141,7 @@ PHP NEWS
. Fixed bug #66431 (Special Character via COM Interface (CP_UTF8)). (Anatol)
- Core:
+ . Improved phpinfo() stylesheets. (Colin Viebrock)
. Fixed bug #67693 (incorrect push to the empty array). (Tjerk)
. Removed inconsistency regarding behaviour of array in constants at
run-time. (Bob)
diff --git a/UPGRADING b/UPGRADING
index d4dd303356..7c5f8c060f 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -217,6 +217,7 @@ PHP 5.6 UPGRADE NOTES
- Strings:
substr_compare() now allows $length to be zero.
+ pack() and unpack() now support 64-bit format specifiers: q, Q, J and P.
- Crypt:
crypt() will now raise an E_NOTICE error if the salt parameter is omitted.
@@ -269,6 +270,7 @@ PHP 5.6 UPGRADE NOTES
Added gmp_root($a, $nth) and gmp_rootrem($a, $nth) for calculating nth roots.
Added gmp_import($data, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
Added gmp_export($gmpnumber, $word_size = 1, $options = GMP_MSW_FIRST | GMP_NATIVE_ENDIAN) in PHP 5.6.1.
+ Added gmp_random_range() and gmp_random_bits() in PHP 5.6.3.
- Hash
Added hash_equals($known_string, $user_string)
diff --git a/Zend/tests/bug67633.phpt b/Zend/tests/bug67633.phpt
new file mode 100644
index 0000000000..a9e05d10ab
--- /dev/null
+++ b/Zend/tests/bug67633.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Bug #67633: A foreach on an array returned from a function not doing copy-on-write
+--FILE--
+<?php
+
+function id($x) {
+ return $x;
+}
+
+function &ref_id(&$x) {
+ return $x;
+}
+
+$c = 'c';
+$array = ['a', 'b', $c];
+
+foreach(id($array) as &$v) {
+ $v .= 'q';
+}
+var_dump($array);
+
+foreach(ref_id($array) as &$v) {
+ $v .= 'q';
+}
+var_dump($array);
+
+?>
+--EXPECT--
+array(3) {
+ [0]=>
+ string(1) "a"
+ [1]=>
+ string(1) "b"
+ [2]=>
+ string(1) "c"
+}
+array(3) {
+ [0]=>
+ string(2) "aq"
+ [1]=>
+ string(2) "bq"
+ [2]=>
+ &string(2) "cq"
+}
diff --git a/Zend/tests/bug67985.phpt b/Zend/tests/bug67985.phpt
new file mode 100644
index 0000000000..6f032643f4
--- /dev/null
+++ b/Zend/tests/bug67985.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #67985 - Last used array index not copied to new array at assignment
+--FILE--
+<?php
+
+$a = ['zero', 'one', 'two'];
+unset($a[2]);
+$b = $a;
+$a[] = 'three';
+$b[] = 'three';
+
+var_dump($a === $b);
+
+?>
+--EXPECT--
+bool(true)
diff --git a/Zend/tests/bug68118.phpt b/Zend/tests/bug68118.phpt
new file mode 100644
index 0000000000..c56e70a112
--- /dev/null
+++ b/Zend/tests/bug68118.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Bug #68118: $a->foo .= 'test'; can leave $a->foo undefined
+--FILE--
+<?php
+
+set_error_handler(function() {
+ $obj = new stdClass;
+ $obj->test = 'meow';
+ return true;
+});
+
+$a = new stdClass;
+$a->undefined .= 'test';
+var_dump($a);
+
+?>
+--EXPECT--
+object(stdClass)#2 (1) {
+ ["undefined"]=>
+ string(4) "test"
+}
diff --git a/Zend/zend.c b/Zend/zend.c
index 891928359d..409befe97b 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -901,7 +901,7 @@ ZEND_API void _zend_bailout(char *filename, uint lineno) /* {{{ */
/* }}} */
END_EXTERN_C()
-void zend_append_version_info(const zend_extension *extension) /* {{{ */
+ZEND_API void zend_append_version_info(const zend_extension *extension) /* {{{ */
{
char *new_info;
uint new_info_length;
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index b8dd3434ca..8472cd7ab1 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -2499,7 +2499,7 @@ ZEND_API void zend_post_deactivate_modules(TSRMLS_D) /* {{{ */
/* }}} */
/* return the next free module number */
-int zend_next_free_module(void) /* {{{ */
+ZEND_API int zend_next_free_module(void) /* {{{ */
{
return zend_hash_num_elements(&module_registry) + 1;
}
diff --git a/Zend/zend_API.h b/Zend/zend_API.h
index efc267f918..0e2a01c819 100644
--- a/Zend/zend_API.h
+++ b/Zend/zend_API.h
@@ -233,7 +233,7 @@ typedef struct _zend_fcall_info_cache {
#define ZEND_FCI_INITIALIZED(fci) ((fci).size != 0)
-int zend_next_free_module(void);
+ZEND_API int zend_next_free_module(void);
BEGIN_EXTERN_C()
ZEND_API int zend_get_parameters(int ht, int param_count, ...);
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 54b01a845b..19185dfb70 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -6337,6 +6337,15 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
/* save the location of FETCH_W instruction(s) */
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
zend_do_end_variable_parse(array, BP_VAR_W, 0 TSRMLS_CC);
+
+ if (zend_is_function_or_method_call(array)) {
+ opline = get_next_op(CG(active_op_array) TSRMLS_CC);
+ opline->opcode = ZEND_SEPARATE;
+ SET_NODE(opline->op1, array);
+ SET_UNUSED(opline->op2);
+ opline->result_type = IS_VAR;
+ opline->result.var = opline->op1.var;
+ }
} else {
is_variable = 0;
open_brackets_token->u.op.opline_num = get_next_op_number(CG(active_op_array));
diff --git a/Zend/zend_extensions.h b/Zend/zend_extensions.h
index 3eda38aa96..5203e53196 100644
--- a/Zend/zend_extensions.h
+++ b/Zend/zend_extensions.h
@@ -111,7 +111,7 @@ END_EXTERN_C()
ZEND_API extern zend_llist zend_extensions;
void zend_extension_dtor(zend_extension *extension);
-void zend_append_version_info(const zend_extension *extension);
+ZEND_API void zend_append_version_info(const zend_extension *extension);
int zend_startup_extensions_mechanism(void);
int zend_startup_extensions(void);
void zend_shutdown_extensions(TSRMLS_D);
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index c7adf38f3b..a5577d0b45 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -786,9 +786,6 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
/* we don't have access controls - will just add it */
new_zval = &EG(uninitialized_zval);
- if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
- zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
- }
Z_ADDREF_P(new_zval);
if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
property_info->offset >= 0) {
@@ -808,6 +805,12 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
}
zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval);
}
+
+ /* Notice is thrown after creation of the property, to avoid EG(std_property_info)
+ * being overwritten in an error handler. */
+ if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
+ zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
+ }
} else {
/* we do have getter - fail and let it try again with usual get/set */
retval = NULL;
diff --git a/Zend/zend_variables.c b/Zend/zend_variables.c
index 0f9e184b7e..8a41902a97 100644
--- a/Zend/zend_variables.c
+++ b/Zend/zend_variables.c
@@ -138,6 +138,7 @@ ZEND_API void _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
ALLOC_HASHTABLE_REL(tmp_ht);
zend_hash_init(tmp_ht, zend_hash_num_elements(original_ht), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_copy(tmp_ht, original_ht, (copy_ctor_func_t) zval_add_ref, (void *) &tmp, sizeof(zval *));
+ tmp_ht->nNextFreeElement = original_ht->nNextFreeElement;
zvalue->value.ht = tmp_ht;
}
break;
diff --git a/configure.in b/configure.in
index 2bef7011ac..8eb08baa3e 100644
--- a/configure.in
+++ b/configure.in
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=5
PHP_MINOR_VERSION=6
-PHP_RELEASE_VERSION=1
+PHP_RELEASE_VERSION=3
PHP_EXTRA_VERSION="-dev"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
@@ -787,7 +787,12 @@ if test "$PHP_GCOV" = "yes"; then
AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
fi
- ltp_version_list="1.5 1.6 1.7 1.9 1.10"
+ dnl min: 1.5 (i.e. 105, major * 100 + minor for easier comparison)
+ ltp_version_min="105"
+ dnl non-working versions, e.g. "1.8 1.18";
+ dnl remove "none" when introducing the first incompatible LTP version an
+ dnl separate any following additions by spaces
+ ltp_version_exclude="1.8"
AC_CHECK_PROG(LTP, lcov, lcov)
AC_CHECK_PROG(LTP_GENHTML, genhtml, genhtml)
@@ -797,21 +802,30 @@ if test "$PHP_GCOV" = "yes"; then
if test "$LTP"; then
AC_CACHE_CHECK([for ltp version], php_cv_ltp_version, [
php_cv_ltp_version=invalid
- ltp_version=`$LTP -v 2>/dev/null | $SED -e 's/^.* //'`
- for ltp_check_version in $ltp_version_list; do
- if test "$ltp_version" = "$ltp_check_version"; then
- php_cv_ltp_version="$ltp_check_version (ok)"
+ ltp_version_vars=`$LTP -v 2>/dev/null | $SED -e 's/^.* //' -e 's/\./ /g' | tr -d a-z`
+ if test -n "$ltp_version_vars"; then
+ set $ltp_version_vars
+ ltp_version="${1}.${2}"
+ ltp_version_num="`expr ${1} \* 100 + ${2}`"
+ if test $ltp_version_num -ge $ltp_version_min; then
+ php_cv_ltp_version="$ltp_version (ok)"
+ for ltp_check_version in $ltp_version_exclude; do
+ if test "$ltp_version" = "$ltp_check_version"; then
+ php_cv_ltp_version=invalid
+ break
+ fi
+ done
fi
- done
+ fi
])
else
- ltp_msg="To enable code coverage reporting you must have one of the following LTP versions installed: $ltp_version_list"
+ ltp_msg="To enable code coverage reporting you must have LTP installed"
AC_MSG_ERROR([$ltp_msg])
fi
case $php_cv_ltp_version in
""|invalid[)]
- ltp_msg="You must have one of the following versions of LTP: $ltp_version_list (found: $ltp_version)."
+ ltp_msg="This LTP version is not supported (found: $ltp_version, min: $ltp_version_min, excluded: $ltp_version_exclude)."
AC_MSG_ERROR([$ltp_msg])
LTP="exit 0;"
;;
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index f8b04295d7..9bb767624c 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -169,6 +169,11 @@ static int php_curl_option_str(php_curl *ch, long option, const char *str, const
{
CURLcode error = CURLE_OK;
+ if (strlen(str) != len) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Curl option contains invalid characters (\\0)");
+ return FAILURE;
+ }
+
#if LIBCURL_VERSION_NUM >= 0x071100
if (make_copy) {
#endif
diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt
new file mode 100644
index 0000000000..3bd5889709
--- /dev/null
+++ b/ext/curl/tests/bug68089.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Bug #68089 (NULL byte injection - cURL lib)
+--SKIPIF--
+<?php
+include 'skipif.inc';
+
+?>
+--FILE--
+<?php
+$url = "file:///etc/passwd\0http://google.com";
+$ch = curl_init();
+var_dump(curl_setopt($ch, CURLOPT_URL, $url));
+?>
+Done
+--EXPECTF--
+Warning: curl_setopt(): Curl option contains invalid characters (\0) in %s/bug68089.php on line 4
+bool(false)
+Done
diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt
index 103f1cf692..d82fe6f41a 100644
--- a/ext/curl/tests/check_win_config.phpt
+++ b/ext/curl/tests/check_win_config.phpt
@@ -28,7 +28,7 @@ Features
AsynchDNS => Yes
CharConv => No
Debug => No
-GSS-Negotiate => Yes
+GSS-Negotiate => No
IDN => Yes
IPv6 => Yes
krb4 => No
diff --git a/ext/date/lib/timezonedb.h b/ext/date/lib/timezonedb.h
index a23104f68c..98e7b2292c 100644
--- a/ext/date/lib/timezonedb.h
+++ b/ext/date/lib/timezonedb.h
@@ -12,578 +12,578 @@ const timelib_tzdb_index_entry timezonedb_idx_builtin[582] = {
{ "Africa/Blantyre" , 0x00052F },
{ "Africa/Brazzaville" , 0x000584 },
{ "Africa/Bujumbura" , 0x0005D9 },
- { "Africa/Cairo" , 0x00061D },
- { "Africa/Casablanca" , 0x000A04 },
- { "Africa/Ceuta" , 0x000C66 },
- { "Africa/Conakry" , 0x000F6D },
- { "Africa/Dakar" , 0x000FC2 },
- { "Africa/Dar_es_Salaam" , 0x001017 },
- { "Africa/Djibouti" , 0x001084 },
- { "Africa/Douala" , 0x0010D9 },
- { "Africa/El_Aaiun" , 0x00112E },
- { "Africa/Freetown" , 0x001359 },
- { "Africa/Gaborone" , 0x0013AE },
- { "Africa/Harare" , 0x00141B },
- { "Africa/Johannesburg" , 0x001470 },
- { "Africa/Juba" , 0x0014DE },
- { "Africa/Kampala" , 0x0015F1 },
- { "Africa/Khartoum" , 0x001670 },
- { "Africa/Kigali" , 0x001783 },
- { "Africa/Kinshasa" , 0x0017D8 },
- { "Africa/Lagos" , 0x001844 },
- { "Africa/Libreville" , 0x001899 },
- { "Africa/Lome" , 0x0018EE },
- { "Africa/Luanda" , 0x001943 },
- { "Africa/Lubumbashi" , 0x001998 },
- { "Africa/Lusaka" , 0x0019F3 },
- { "Africa/Malabo" , 0x001A48 },
- { "Africa/Maputo" , 0x001A9D },
- { "Africa/Maseru" , 0x001AF2 },
- { "Africa/Mbabane" , 0x001B5A },
- { "Africa/Mogadishu" , 0x001BB0 },
- { "Africa/Monrovia" , 0x001C0B },
- { "Africa/Nairobi" , 0x001C71 },
- { "Africa/Ndjamena" , 0x001CF0 },
- { "Africa/Niamey" , 0x001D5C },
- { "Africa/Nouakchott" , 0x001DB1 },
- { "Africa/Ouagadougou" , 0x001E06 },
- { "Africa/Porto-Novo" , 0x001E5B },
- { "Africa/Sao_Tome" , 0x001EB0 },
- { "Africa/Timbuktu" , 0x001F05 },
- { "Africa/Tripoli" , 0x001F5A },
- { "Africa/Tunis" , 0x002063 },
- { "Africa/Windhoek" , 0x002175 },
- { "America/Adak" , 0x0023BC },
- { "America/Anchorage" , 0x002732 },
- { "America/Anguilla" , 0x002AA6 },
- { "America/Antigua" , 0x002AFB },
- { "America/Araguaina" , 0x002B61 },
- { "America/Argentina/Buenos_Aires" , 0x002CC6 },
- { "America/Argentina/Catamarca" , 0x002E74 },
- { "America/Argentina/ComodRivadavia" , 0x003035 },
- { "America/Argentina/Cordoba" , 0x0031DB },
- { "America/Argentina/Jujuy" , 0x0033B0 },
- { "America/Argentina/La_Rioja" , 0x003564 },
- { "America/Argentina/Mendoza" , 0x00371C },
- { "America/Argentina/Rio_Gallegos" , 0x0038DC },
- { "America/Argentina/Salta" , 0x003A91 },
- { "America/Argentina/San_Juan" , 0x003C3D },
- { "America/Argentina/San_Luis" , 0x003DF5 },
- { "America/Argentina/Tucuman" , 0x003FBB },
- { "America/Argentina/Ushuaia" , 0x004177 },
- { "America/Aruba" , 0x004332 },
- { "America/Asuncion" , 0x004398 },
- { "America/Atikokan" , 0x00467D },
- { "America/Atka" , 0x004753 },
- { "America/Bahia" , 0x004AB9 },
- { "America/Bahia_Banderas" , 0x004C4C },
- { "America/Barbados" , 0x004EC5 },
- { "America/Belem" , 0x004F5F },
- { "America/Belize" , 0x00505A },
- { "America/Blanc-Sablon" , 0x0051D6 },
- { "America/Boa_Vista" , 0x00528A },
- { "America/Bogota" , 0x005393 },
- { "America/Boise" , 0x0053FF },
- { "America/Buenos_Aires" , 0x005796 },
- { "America/Cambridge_Bay" , 0x00592F },
- { "America/Campo_Grande" , 0x005C57 },
- { "America/Cancun" , 0x005F46 },
- { "America/Caracas" , 0x006188 },
- { "America/Catamarca" , 0x0061EF },
- { "America/Cayenne" , 0x006395 },
- { "America/Cayman" , 0x0063F7 },
- { "America/Chicago" , 0x00644C },
- { "America/Chihuahua" , 0x006963 },
- { "America/Coral_Harbour" , 0x006BCE },
- { "America/Cordoba" , 0x006C60 },
- { "America/Costa_Rica" , 0x006E06 },
- { "America/Creston" , 0x006E90 },
- { "America/Cuiaba" , 0x006F1C },
- { "America/Curacao" , 0x0071FA },
- { "America/Danmarkshavn" , 0x007260 },
- { "America/Dawson" , 0x0073A4 },
- { "America/Dawson_Creek" , 0x0076C1 },
- { "America/Denver" , 0x00789B },
- { "America/Detroit" , 0x007C21 },
- { "America/Dominica" , 0x007F80 },
- { "America/Edmonton" , 0x007FD5 },
- { "America/Eirunepe" , 0x00838D },
- { "America/El_Salvador" , 0x0084A5 },
- { "America/Ensenada" , 0x00851A },
- { "America/Fort_Wayne" , 0x0089C1 },
- { "America/Fortaleza" , 0x008883 },
- { "America/Glace_Bay" , 0x008C2B },
- { "America/Godthab" , 0x008FA2 },
- { "America/Goose_Bay" , 0x009266 },
- { "America/Grand_Turk" , 0x009723 },
- { "America/Grenada" , 0x0098F8 },
- { "America/Guadeloupe" , 0x00994D },
- { "America/Guatemala" , 0x0099A2 },
- { "America/Guayaquil" , 0x009A2B },
- { "America/Guyana" , 0x009A88 },
- { "America/Halifax" , 0x009B09 },
- { "America/Havana" , 0x00A01F },
- { "America/Hermosillo" , 0x00A392 },
- { "America/Indiana/Indianapolis" , 0x00A470 },
- { "America/Indiana/Knox" , 0x00A701 },
- { "America/Indiana/Marengo" , 0x00AA98 },
- { "America/Indiana/Petersburg" , 0x00AD3E },
- { "America/Indiana/Tell_City" , 0x00B28B },
- { "America/Indiana/Vevay" , 0x00B524 },
- { "America/Indiana/Vincennes" , 0x00B75F },
- { "America/Indiana/Winamac" , 0x00BA13 },
- { "America/Indianapolis" , 0x00B021 },
- { "America/Inuvik" , 0x00BCCC },
- { "America/Iqaluit" , 0x00BFC3 },
- { "America/Jamaica" , 0x00C2E5 },
- { "America/Jujuy" , 0x00C3AA },
- { "America/Juneau" , 0x00C554 },
- { "America/Kentucky/Louisville" , 0x00C8D2 },
- { "America/Kentucky/Monticello" , 0x00CCF0 },
- { "America/Knox_IN" , 0x00D075 },
- { "America/Kralendijk" , 0x00D3E6 },
- { "America/La_Paz" , 0x00D44C },
- { "America/Lima" , 0x00D4B3 },
- { "America/Los_Angeles" , 0x00D55B },
- { "America/Louisville" , 0x00D96C },
- { "America/Lower_Princes" , 0x00DD61 },
- { "America/Maceio" , 0x00DDC7 },
- { "America/Managua" , 0x00DF01 },
- { "America/Manaus" , 0x00DFB4 },
- { "America/Marigot" , 0x00E0B6 },
- { "America/Martinique" , 0x00E10B },
- { "America/Matamoros" , 0x00E177 },
- { "America/Mazatlan" , 0x00E3D0 },
- { "America/Mendoza" , 0x00E63D },
- { "America/Menominee" , 0x00E7F1 },
- { "America/Merida" , 0x00EB72 },
- { "America/Metlakatla" , 0x00EDAD },
- { "America/Mexico_City" , 0x00EEE8 },
- { "America/Miquelon" , 0x00F163 },
- { "America/Moncton" , 0x00F3D5 },
- { "America/Monterrey" , 0x00F86C },
- { "America/Montevideo" , 0x00FACF },
- { "America/Montreal" , 0x00FDE1 },
- { "America/Montserrat" , 0x0102D1 },
- { "America/Nassau" , 0x010326 },
- { "America/New_York" , 0x01066B },
- { "America/Nipigon" , 0x010B76 },
- { "America/Nome" , 0x010EC7 },
- { "America/Noronha" , 0x011245 },
- { "America/North_Dakota/Beulah" , 0x011375 },
- { "America/North_Dakota/Center" , 0x011709 },
- { "America/North_Dakota/New_Salem" , 0x011A9D },
- { "America/Ojinaga" , 0x011E46 },
- { "America/Panama" , 0x0120A7 },
- { "America/Pangnirtung" , 0x0120FC },
- { "America/Paramaribo" , 0x012432 },
- { "America/Phoenix" , 0x0124C4 },
- { "America/Port-au-Prince" , 0x012582 },
- { "America/Port_of_Spain" , 0x0128A6 },
- { "America/Porto_Acre" , 0x0127A2 },
- { "America/Porto_Velho" , 0x0128FB },
- { "America/Puerto_Rico" , 0x0129F1 },
- { "America/Rainy_River" , 0x012A5C },
- { "America/Rankin_Inlet" , 0x012D94 },
- { "America/Recife" , 0x01307A },
- { "America/Regina" , 0x0131A4 },
- { "America/Resolute" , 0x013362 },
- { "America/Rio_Branco" , 0x01364A },
- { "America/Rosario" , 0x013752 },
- { "America/Santa_Isabel" , 0x0138F8 },
- { "America/Santarem" , 0x013C9B },
- { "America/Santiago" , 0x013DA0 },
- { "America/Santo_Domingo" , 0x014149 },
- { "America/Sao_Paulo" , 0x01420F },
- { "America/Scoresbysund" , 0x01451E },
- { "America/Shiprock" , 0x01480C },
- { "America/Sitka" , 0x014B85 },
- { "America/St_Barthelemy" , 0x014F0D },
- { "America/St_Johns" , 0x014F62 },
- { "America/St_Kitts" , 0x0154B5 },
- { "America/St_Lucia" , 0x01550A },
- { "America/St_Thomas" , 0x01555F },
- { "America/St_Vincent" , 0x0155B4 },
- { "America/Swift_Current" , 0x015609 },
- { "America/Tegucigalpa" , 0x01572A },
- { "America/Thule" , 0x0157A9 },
- { "America/Thunder_Bay" , 0x0159F0 },
- { "America/Tijuana" , 0x015D39 },
- { "America/Toronto" , 0x0160D2 },
- { "America/Tortola" , 0x0165F2 },
- { "America/Vancouver" , 0x016647 },
- { "America/Virgin" , 0x016A84 },
- { "America/Whitehorse" , 0x016AD9 },
- { "America/Winnipeg" , 0x016DF6 },
- { "America/Yakutat" , 0x017236 },
- { "America/Yellowknife" , 0x0175A1 },
- { "Antarctica/Casey" , 0x0178B1 },
- { "Antarctica/Davis" , 0x01794F },
- { "Antarctica/DumontDUrville" , 0x0179F0 },
- { "Antarctica/Macquarie" , 0x017A81 },
- { "Antarctica/Mawson" , 0x017CCE },
- { "Antarctica/McMurdo" , 0x017D4A },
- { "Antarctica/Palmer" , 0x0180F5 },
- { "Antarctica/Rothera" , 0x018411 },
- { "Antarctica/South_Pole" , 0x018487 },
- { "Antarctica/Syowa" , 0x018805 },
- { "Antarctica/Troll" , 0x018873 },
- { "Antarctica/Vostok" , 0x018A45 },
- { "Arctic/Longyearbyen" , 0x018AB6 },
- { "Asia/Aden" , 0x018DE8 },
- { "Asia/Almaty" , 0x018E3D },
- { "Asia/Amman" , 0x018FBC },
- { "Asia/Anadyr" , 0x019272 },
- { "Asia/Aqtau" , 0x019474 },
- { "Asia/Aqtobe" , 0x019673 },
- { "Asia/Ashgabat" , 0x01982B },
- { "Asia/Ashkhabad" , 0x019948 },
- { "Asia/Baghdad" , 0x019A65 },
- { "Asia/Bahrain" , 0x019BDA },
- { "Asia/Baku" , 0x019C40 },
- { "Asia/Bangkok" , 0x019F28 },
- { "Asia/Beirut" , 0x019F7D },
- { "Asia/Bishkek" , 0x01A28A },
- { "Asia/Brunei" , 0x01A436 },
- { "Asia/Calcutta" , 0x01A498 },
- { "Asia/Chita" , 0x01A511 },
- { "Asia/Choibalsan" , 0x01A726 },
- { "Asia/Chongqing" , 0x01A89F },
- { "Asia/Chungking" , 0x01A93F },
- { "Asia/Colombo" , 0x01A9DF },
- { "Asia/Dacca" , 0x01AA7B },
- { "Asia/Damascus" , 0x01AB21 },
- { "Asia/Dhaka" , 0x01AE71 },
- { "Asia/Dili" , 0x01AF17 },
- { "Asia/Dubai" , 0x01AFA1 },
- { "Asia/Dushanbe" , 0x01AFF6 },
- { "Asia/Gaza" , 0x01B0F9 },
- { "Asia/Harbin" , 0x01B44C },
- { "Asia/Hebron" , 0x01B4EC },
- { "Asia/Ho_Chi_Minh" , 0x01B848 },
- { "Asia/Hong_Kong" , 0x01B8C0 },
- { "Asia/Hovd" , 0x01BA82 },
- { "Asia/Irkutsk" , 0x01BBFA },
- { "Asia/Istanbul" , 0x01BDE5 },
- { "Asia/Jakarta" , 0x01C1D2 },
- { "Asia/Jayapura" , 0x01C27C },
- { "Asia/Jerusalem" , 0x01C319 },
- { "Asia/Kabul" , 0x01C648 },
- { "Asia/Kamchatka" , 0x01C699 },
- { "Asia/Karachi" , 0x01C892 },
- { "Asia/Kashgar" , 0x01C947 },
- { "Asia/Kathmandu" , 0x01C99C },
- { "Asia/Katmandu" , 0x01CA02 },
- { "Asia/Khandyga" , 0x01CA68 },
- { "Asia/Kolkata" , 0x01CC92 },
- { "Asia/Krasnoyarsk" , 0x01CD0B },
- { "Asia/Kuala_Lumpur" , 0x01CEF8 },
- { "Asia/Kuching" , 0x01CFB5 },
- { "Asia/Kuwait" , 0x01D0A3 },
- { "Asia/Macao" , 0x01D0F8 },
- { "Asia/Macau" , 0x01D233 },
- { "Asia/Magadan" , 0x01D36E },
- { "Asia/Makassar" , 0x01D572 },
- { "Asia/Manila" , 0x01D637 },
- { "Asia/Muscat" , 0x01D6BC },
- { "Asia/Nicosia" , 0x01D711 },
- { "Asia/Novokuznetsk" , 0x01D9F9 },
- { "Asia/Novosibirsk" , 0x01DC19 },
- { "Asia/Omsk" , 0x01DE09 },
- { "Asia/Oral" , 0x01DFF5 },
- { "Asia/Phnom_Penh" , 0x01E1C5 },
- { "Asia/Pontianak" , 0x01E23D },
- { "Asia/Pyongyang" , 0x01E2FF },
- { "Asia/Qatar" , 0x01E38F },
- { "Asia/Qyzylorda" , 0x01E3F5 },
- { "Asia/Rangoon" , 0x01E5CB },
- { "Asia/Riyadh" , 0x01E643 },
- { "Asia/Saigon" , 0x01E698 },
- { "Asia/Sakhalin" , 0x01E710 },
- { "Asia/Samarkand" , 0x01E90D },
- { "Asia/Seoul" , 0x01EA43 },
- { "Asia/Shanghai" , 0x01EB0A },
- { "Asia/Singapore" , 0x01EBB6 },
- { "Asia/Srednekolymsk" , 0x01EC6D },
- { "Asia/Taipei" , 0x01EE6D },
- { "Asia/Tashkent" , 0x01EF9E },
- { "Asia/Tbilisi" , 0x01F0CF },
- { "Asia/Tehran" , 0x01F289 },
- { "Asia/Tel_Aviv" , 0x01F4F7 },
- { "Asia/Thimbu" , 0x01F826 },
- { "Asia/Thimphu" , 0x01F88C },
- { "Asia/Tokyo" , 0x01F8F2 },
- { "Asia/Ujung_Pandang" , 0x01F97C },
- { "Asia/Ulaanbaatar" , 0x01F9F9 },
- { "Asia/Ulan_Bator" , 0x01FB54 },
- { "Asia/Urumqi" , 0x01FCA1 },
- { "Asia/Ust-Nera" , 0x01FD03 },
- { "Asia/Vientiane" , 0x01FF15 },
- { "Asia/Vladivostok" , 0x01FF8D },
- { "Asia/Yakutsk" , 0x020177 },
- { "Asia/Yekaterinburg" , 0x020361 },
- { "Asia/Yerevan" , 0x020582 },
- { "Atlantic/Azores" , 0x020782 },
- { "Atlantic/Bermuda" , 0x020C85 },
- { "Atlantic/Canary" , 0x020F66 },
- { "Atlantic/Cape_Verde" , 0x02123C },
- { "Atlantic/Faeroe" , 0x0212B5 },
- { "Atlantic/Faroe" , 0x021559 },
- { "Atlantic/Jan_Mayen" , 0x0217FD },
- { "Atlantic/Madeira" , 0x021B2F },
- { "Atlantic/Reykjavik" , 0x022038 },
- { "Atlantic/South_Georgia" , 0x0221F1 },
- { "Atlantic/St_Helena" , 0x022403 },
- { "Atlantic/Stanley" , 0x022235 },
- { "Australia/ACT" , 0x022458 },
- { "Australia/Adelaide" , 0x02277B },
- { "Australia/Brisbane" , 0x022AAD },
- { "Australia/Broken_Hill" , 0x022B7A },
- { "Australia/Canberra" , 0x022EBE },
- { "Australia/Currie" , 0x0231E1 },
- { "Australia/Darwin" , 0x02351A },
- { "Australia/Eucla" , 0x0235A6 },
- { "Australia/Hobart" , 0x023682 },
- { "Australia/LHI" , 0x0239E6 },
- { "Australia/Lindeman" , 0x023C87 },
- { "Australia/Lord_Howe" , 0x023D6E },
- { "Australia/Melbourne" , 0x02401F },
- { "Australia/North" , 0x02434A },
- { "Australia/NSW" , 0x0243C4 },
- { "Australia/Perth" , 0x0246E7 },
- { "Australia/Queensland" , 0x0247C5 },
- { "Australia/South" , 0x024877 },
- { "Australia/Sydney" , 0x024B9A },
- { "Australia/Tasmania" , 0x024EDD },
- { "Australia/Victoria" , 0x025228 },
- { "Australia/West" , 0x02554B },
- { "Australia/Yancowinna" , 0x025607 },
- { "Brazil/Acre" , 0x02592F },
- { "Brazil/DeNoronha" , 0x025A33 },
- { "Brazil/East" , 0x025B53 },
- { "Brazil/West" , 0x025E30 },
- { "Canada/Atlantic" , 0x025F28 },
- { "Canada/Central" , 0x026410 },
- { "Canada/East-Saskatchewan" , 0x026D1A },
- { "Canada/Eastern" , 0x02682A },
- { "Canada/Mountain" , 0x026EA3 },
- { "Canada/Newfoundland" , 0x027219 },
- { "Canada/Pacific" , 0x027744 },
- { "Canada/Saskatchewan" , 0x027B5D },
- { "Canada/Yukon" , 0x027CE6 },
- { "CET" , 0x027FE9 },
- { "Chile/Continental" , 0x0282F2 },
- { "Chile/EasterIsland" , 0x02868D },
- { "CST6CDT" , 0x0289CF },
- { "Cuba" , 0x028D20 },
- { "EET" , 0x029093 },
- { "Egypt" , 0x029346 },
- { "Eire" , 0x02972D },
- { "EST" , 0x029C3E },
- { "EST5EDT" , 0x029C82 },
- { "Etc/GMT" , 0x029FD3 },
- { "Etc/GMT+0" , 0x02A09F },
- { "Etc/GMT+1" , 0x02A129 },
- { "Etc/GMT+10" , 0x02A1B6 },
- { "Etc/GMT+11" , 0x02A244 },
- { "Etc/GMT+12" , 0x02A2D2 },
- { "Etc/GMT+2" , 0x02A3ED },
- { "Etc/GMT+3" , 0x02A479 },
- { "Etc/GMT+4" , 0x02A505 },
- { "Etc/GMT+5" , 0x02A591 },
- { "Etc/GMT+6" , 0x02A61D },
- { "Etc/GMT+7" , 0x02A6A9 },
- { "Etc/GMT+8" , 0x02A735 },
- { "Etc/GMT+9" , 0x02A7C1 },
- { "Etc/GMT-0" , 0x02A05B },
- { "Etc/GMT-1" , 0x02A0E3 },
- { "Etc/GMT-10" , 0x02A16F },
- { "Etc/GMT-11" , 0x02A1FD },
- { "Etc/GMT-12" , 0x02A28B },
- { "Etc/GMT-13" , 0x02A319 },
- { "Etc/GMT-14" , 0x02A360 },
- { "Etc/GMT-2" , 0x02A3A7 },
- { "Etc/GMT-3" , 0x02A433 },
- { "Etc/GMT-4" , 0x02A4BF },
- { "Etc/GMT-5" , 0x02A54B },
- { "Etc/GMT-6" , 0x02A5D7 },
- { "Etc/GMT-7" , 0x02A663 },
- { "Etc/GMT-8" , 0x02A6EF },
- { "Etc/GMT-9" , 0x02A77B },
- { "Etc/GMT0" , 0x02A017 },
- { "Etc/Greenwich" , 0x02A807 },
- { "Etc/UCT" , 0x02A84B },
- { "Etc/Universal" , 0x02A88F },
- { "Etc/UTC" , 0x02A8D3 },
- { "Etc/Zulu" , 0x02A917 },
- { "Europe/Amsterdam" , 0x02A95B },
- { "Europe/Andorra" , 0x02AD99 },
- { "Europe/Athens" , 0x02B015 },
- { "Europe/Belfast" , 0x02B358 },
- { "Europe/Belgrade" , 0x02B88F },
- { "Europe/Berlin" , 0x02BB58 },
- { "Europe/Bratislava" , 0x02BEBC },
- { "Europe/Brussels" , 0x02C1EE },
- { "Europe/Bucharest" , 0x02C625 },
- { "Europe/Budapest" , 0x02C94F },
- { "Europe/Busingen" , 0x02CCB8 },
- { "Europe/Chisinau" , 0x02CF6F },
- { "Europe/Copenhagen" , 0x02D2FD },
- { "Europe/Dublin" , 0x02D607 },
- { "Europe/Gibraltar" , 0x02DB18 },
- { "Europe/Guernsey" , 0x02DF6F },
- { "Europe/Helsinki" , 0x02E4A6 },
- { "Europe/Isle_of_Man" , 0x02E75C },
- { "Europe/Istanbul" , 0x02EC93 },
- { "Europe/Jersey" , 0x02F080 },
- { "Europe/Kaliningrad" , 0x02F5B7 },
- { "Europe/Kiev" , 0x02F822 },
- { "Europe/Lisbon" , 0x02FB3E },
- { "Europe/Ljubljana" , 0x030042 },
- { "Europe/London" , 0x03030B },
- { "Europe/Luxembourg" , 0x030842 },
- { "Europe/Madrid" , 0x030C98 },
- { "Europe/Malta" , 0x03105E },
- { "Europe/Mariehamn" , 0x031417 },
- { "Europe/Minsk" , 0x0316CD },
- { "Europe/Monaco" , 0x0318DB },
- { "Europe/Moscow" , 0x031D16 },
- { "Europe/Nicosia" , 0x031F70 },
- { "Europe/Oslo" , 0x032258 },
- { "Europe/Paris" , 0x03258A },
- { "Europe/Podgorica" , 0x0329D0 },
- { "Europe/Prague" , 0x032C99 },
- { "Europe/Riga" , 0x032FCB },
- { "Europe/Rome" , 0x033310 },
- { "Europe/Samara" , 0x0336D3 },
- { "Europe/San_Marino" , 0x03393C },
- { "Europe/Sarajevo" , 0x033CFF },
- { "Europe/Simferopol" , 0x033FC8 },
- { "Europe/Skopje" , 0x034219 },
- { "Europe/Sofia" , 0x0344E2 },
- { "Europe/Stockholm" , 0x0347EA },
- { "Europe/Tallinn" , 0x034A99 },
- { "Europe/Tirane" , 0x034DD3 },
- { "Europe/Tiraspol" , 0x0350D9 },
- { "Europe/Uzhgorod" , 0x035467 },
- { "Europe/Vaduz" , 0x03577E },
- { "Europe/Vatican" , 0x035A2D },
- { "Europe/Vienna" , 0x035DF0 },
- { "Europe/Vilnius" , 0x03611D },
- { "Europe/Volgograd" , 0x03645C },
- { "Europe/Warsaw" , 0x03667D },
- { "Europe/Zagreb" , 0x036A5E },
- { "Europe/Zaporozhye" , 0x036D27 },
- { "Europe/Zurich" , 0x037068 },
- { "Factory" , 0x037317 },
- { "GB" , 0x037388 },
- { "GB-Eire" , 0x0378BF },
- { "GMT" , 0x037DF6 },
- { "GMT+0" , 0x037EC2 },
- { "GMT-0" , 0x037E7E },
- { "GMT0" , 0x037E3A },
- { "Greenwich" , 0x037F06 },
- { "Hongkong" , 0x037F4A },
- { "HST" , 0x03810C },
- { "Iceland" , 0x038150 },
- { "Indian/Antananarivo" , 0x038309 },
- { "Indian/Chagos" , 0x03837D },
- { "Indian/Christmas" , 0x0383DF },
- { "Indian/Cocos" , 0x038423 },
- { "Indian/Comoro" , 0x038467 },
- { "Indian/Kerguelen" , 0x0384BC },
- { "Indian/Mahe" , 0x038511 },
- { "Indian/Maldives" , 0x038566 },
- { "Indian/Mauritius" , 0x0385BB },
- { "Indian/Mayotte" , 0x038631 },
- { "Indian/Reunion" , 0x038686 },
- { "Iran" , 0x0386DB },
- { "Israel" , 0x038949 },
- { "Jamaica" , 0x038C78 },
- { "Japan" , 0x038D3D },
- { "Kwajalein" , 0x038DC7 },
- { "Libya" , 0x038E2A },
- { "MET" , 0x038F33 },
- { "Mexico/BajaNorte" , 0x03923C },
- { "Mexico/BajaSur" , 0x0395A5 },
- { "Mexico/General" , 0x0397EA },
- { "MST" , 0x039A48 },
- { "MST7MDT" , 0x039A8C },
- { "Navajo" , 0x039DDD },
- { "NZ" , 0x03A156 },
- { "NZ-CHAT" , 0x03A4D4 },
- { "Pacific/Apia" , 0x03A7B8 },
- { "Pacific/Auckland" , 0x03A954 },
- { "Pacific/Chatham" , 0x03ACE0 },
- { "Pacific/Chuuk" , 0x03AFD3 },
- { "Pacific/Easter" , 0x03B02C },
- { "Pacific/Efate" , 0x03B37B },
- { "Pacific/Enderbury" , 0x03B441 },
- { "Pacific/Fakaofo" , 0x03B4AF },
- { "Pacific/Fiji" , 0x03B500 },
- { "Pacific/Funafuti" , 0x03B693 },
- { "Pacific/Galapagos" , 0x03B6D7 },
- { "Pacific/Gambier" , 0x03B74F },
- { "Pacific/Guadalcanal" , 0x03B7B4 },
- { "Pacific/Guam" , 0x03B809 },
- { "Pacific/Honolulu" , 0x03B85F },
- { "Pacific/Johnston" , 0x03B8D6 },
- { "Pacific/Kiritimati" , 0x03B955 },
- { "Pacific/Kosrae" , 0x03B9C0 },
- { "Pacific/Kwajalein" , 0x03BA1D },
- { "Pacific/Majuro" , 0x03BA89 },
- { "Pacific/Marquesas" , 0x03BAE8 },
- { "Pacific/Midway" , 0x03BB4F },
- { "Pacific/Nauru" , 0x03BBD9 },
- { "Pacific/Niue" , 0x03BC51 },
- { "Pacific/Norfolk" , 0x03BCAF },
- { "Pacific/Noumea" , 0x03BD04 },
- { "Pacific/Pago_Pago" , 0x03BD94 },
- { "Pacific/Palau" , 0x03BE0B },
- { "Pacific/Pitcairn" , 0x03BE4F },
- { "Pacific/Pohnpei" , 0x03BEA4 },
- { "Pacific/Ponape" , 0x03BEF9 },
- { "Pacific/Port_Moresby" , 0x03BF3E },
- { "Pacific/Rarotonga" , 0x03BF82 },
- { "Pacific/Saipan" , 0x03C05E },
- { "Pacific/Samoa" , 0x03C0C1 },
- { "Pacific/Tahiti" , 0x03C138 },
- { "Pacific/Tarawa" , 0x03C19D },
- { "Pacific/Tongatapu" , 0x03C1F1 },
- { "Pacific/Truk" , 0x03C27D },
- { "Pacific/Wake" , 0x03C2C2 },
- { "Pacific/Wallis" , 0x03C312 },
- { "Pacific/Yap" , 0x03C356 },
- { "Poland" , 0x03C39B },
- { "Portugal" , 0x03C77C },
- { "PRC" , 0x03CC78 },
- { "PST8PDT" , 0x03CD18 },
- { "ROC" , 0x03D069 },
- { "ROK" , 0x03D19A },
- { "Singapore" , 0x03D261 },
- { "Turkey" , 0x03D318 },
- { "UCT" , 0x03D705 },
- { "Universal" , 0x03D749 },
- { "US/Alaska" , 0x03D78D },
- { "US/Aleutian" , 0x03DAF6 },
- { "US/Arizona" , 0x03DE5C },
- { "US/Central" , 0x03DEEA },
- { "US/East-Indiana" , 0x03E8F4 },
- { "US/Eastern" , 0x03E3F5 },
- { "US/Hawaii" , 0x03EB5E },
- { "US/Indiana-Starke" , 0x03EBCF },
- { "US/Michigan" , 0x03EF40 },
- { "US/Mountain" , 0x03F277 },
- { "US/Pacific" , 0x03F5F0 },
- { "US/Pacific-New" , 0x03F9F5 },
- { "US/Samoa" , 0x03FDFA },
- { "UTC" , 0x03FE71 },
- { "W-SU" , 0x040168 },
- { "WET" , 0x03FEB5 },
- { "Zulu" , 0x0403AB },
+ { "Africa/Cairo" , 0x00062E },
+ { "Africa/Casablanca" , 0x000A15 },
+ { "Africa/Ceuta" , 0x000C77 },
+ { "Africa/Conakry" , 0x000F7E },
+ { "Africa/Dakar" , 0x000FD3 },
+ { "Africa/Dar_es_Salaam" , 0x001028 },
+ { "Africa/Djibouti" , 0x001095 },
+ { "Africa/Douala" , 0x0010EA },
+ { "Africa/El_Aaiun" , 0x00113F },
+ { "Africa/Freetown" , 0x00136A },
+ { "Africa/Gaborone" , 0x0013BF },
+ { "Africa/Harare" , 0x001414 },
+ { "Africa/Johannesburg" , 0x001469 },
+ { "Africa/Juba" , 0x0014D7 },
+ { "Africa/Kampala" , 0x0015EA },
+ { "Africa/Khartoum" , 0x001669 },
+ { "Africa/Kigali" , 0x00177C },
+ { "Africa/Kinshasa" , 0x0017D1 },
+ { "Africa/Lagos" , 0x00183D },
+ { "Africa/Libreville" , 0x001892 },
+ { "Africa/Lome" , 0x0018E7 },
+ { "Africa/Luanda" , 0x00193C },
+ { "Africa/Lubumbashi" , 0x001991 },
+ { "Africa/Lusaka" , 0x0019FD },
+ { "Africa/Malabo" , 0x001A52 },
+ { "Africa/Maputo" , 0x001AA7 },
+ { "Africa/Maseru" , 0x001AFC },
+ { "Africa/Mbabane" , 0x001B6A },
+ { "Africa/Mogadishu" , 0x001BD8 },
+ { "Africa/Monrovia" , 0x001C33 },
+ { "Africa/Nairobi" , 0x001C99 },
+ { "Africa/Ndjamena" , 0x001D18 },
+ { "Africa/Niamey" , 0x001D84 },
+ { "Africa/Nouakchott" , 0x001DD9 },
+ { "Africa/Ouagadougou" , 0x001E2E },
+ { "Africa/Porto-Novo" , 0x001E83 },
+ { "Africa/Sao_Tome" , 0x001ED8 },
+ { "Africa/Timbuktu" , 0x001F2D },
+ { "Africa/Tripoli" , 0x001F82 },
+ { "Africa/Tunis" , 0x00208B },
+ { "Africa/Windhoek" , 0x00219D },
+ { "America/Adak" , 0x0023E4 },
+ { "America/Anchorage" , 0x00275A },
+ { "America/Anguilla" , 0x002ACE },
+ { "America/Antigua" , 0x002B23 },
+ { "America/Araguaina" , 0x002B89 },
+ { "America/Argentina/Buenos_Aires" , 0x002CEE },
+ { "America/Argentina/Catamarca" , 0x002E9C },
+ { "America/Argentina/ComodRivadavia" , 0x00305D },
+ { "America/Argentina/Cordoba" , 0x003203 },
+ { "America/Argentina/Jujuy" , 0x0033D8 },
+ { "America/Argentina/La_Rioja" , 0x00358C },
+ { "America/Argentina/Mendoza" , 0x003744 },
+ { "America/Argentina/Rio_Gallegos" , 0x003904 },
+ { "America/Argentina/Salta" , 0x003AB9 },
+ { "America/Argentina/San_Juan" , 0x003C65 },
+ { "America/Argentina/San_Luis" , 0x003E1D },
+ { "America/Argentina/Tucuman" , 0x003FE3 },
+ { "America/Argentina/Ushuaia" , 0x00419F },
+ { "America/Aruba" , 0x00435A },
+ { "America/Asuncion" , 0x0043C0 },
+ { "America/Atikokan" , 0x0046A5 },
+ { "America/Atka" , 0x00477B },
+ { "America/Bahia" , 0x004AE1 },
+ { "America/Bahia_Banderas" , 0x004C74 },
+ { "America/Barbados" , 0x004EED },
+ { "America/Belem" , 0x004F87 },
+ { "America/Belize" , 0x005082 },
+ { "America/Blanc-Sablon" , 0x0051FE },
+ { "America/Boa_Vista" , 0x0052B2 },
+ { "America/Bogota" , 0x0053BB },
+ { "America/Boise" , 0x005427 },
+ { "America/Buenos_Aires" , 0x0057BE },
+ { "America/Cambridge_Bay" , 0x005957 },
+ { "America/Campo_Grande" , 0x005C7F },
+ { "America/Cancun" , 0x005F6E },
+ { "America/Caracas" , 0x0061B0 },
+ { "America/Catamarca" , 0x006217 },
+ { "America/Cayenne" , 0x0063BD },
+ { "America/Cayman" , 0x00641F },
+ { "America/Chicago" , 0x006474 },
+ { "America/Chihuahua" , 0x00698B },
+ { "America/Coral_Harbour" , 0x006BF6 },
+ { "America/Cordoba" , 0x006C88 },
+ { "America/Costa_Rica" , 0x006E2E },
+ { "America/Creston" , 0x006EB8 },
+ { "America/Cuiaba" , 0x006F44 },
+ { "America/Curacao" , 0x007222 },
+ { "America/Danmarkshavn" , 0x007288 },
+ { "America/Dawson" , 0x0073CC },
+ { "America/Dawson_Creek" , 0x0076E9 },
+ { "America/Denver" , 0x0078C3 },
+ { "America/Detroit" , 0x007C49 },
+ { "America/Dominica" , 0x007FA8 },
+ { "America/Edmonton" , 0x007FFD },
+ { "America/Eirunepe" , 0x0083B5 },
+ { "America/El_Salvador" , 0x0084CD },
+ { "America/Ensenada" , 0x008542 },
+ { "America/Fort_Wayne" , 0x0089E9 },
+ { "America/Fortaleza" , 0x0088AB },
+ { "America/Glace_Bay" , 0x008C53 },
+ { "America/Godthab" , 0x008FCA },
+ { "America/Goose_Bay" , 0x00928E },
+ { "America/Grand_Turk" , 0x00974B },
+ { "America/Grenada" , 0x009920 },
+ { "America/Guadeloupe" , 0x009975 },
+ { "America/Guatemala" , 0x0099CA },
+ { "America/Guayaquil" , 0x009A53 },
+ { "America/Guyana" , 0x009AB0 },
+ { "America/Halifax" , 0x009B31 },
+ { "America/Havana" , 0x00A047 },
+ { "America/Hermosillo" , 0x00A3BA },
+ { "America/Indiana/Indianapolis" , 0x00A498 },
+ { "America/Indiana/Knox" , 0x00A729 },
+ { "America/Indiana/Marengo" , 0x00AAC0 },
+ { "America/Indiana/Petersburg" , 0x00AD66 },
+ { "America/Indiana/Tell_City" , 0x00B2B3 },
+ { "America/Indiana/Vevay" , 0x00B54C },
+ { "America/Indiana/Vincennes" , 0x00B787 },
+ { "America/Indiana/Winamac" , 0x00BA3B },
+ { "America/Indianapolis" , 0x00B049 },
+ { "America/Inuvik" , 0x00BCF4 },
+ { "America/Iqaluit" , 0x00BFEB },
+ { "America/Jamaica" , 0x00C30D },
+ { "America/Jujuy" , 0x00C3D2 },
+ { "America/Juneau" , 0x00C57C },
+ { "America/Kentucky/Louisville" , 0x00C8FA },
+ { "America/Kentucky/Monticello" , 0x00CD18 },
+ { "America/Knox_IN" , 0x00D09D },
+ { "America/Kralendijk" , 0x00D40E },
+ { "America/La_Paz" , 0x00D474 },
+ { "America/Lima" , 0x00D4DB },
+ { "America/Los_Angeles" , 0x00D583 },
+ { "America/Louisville" , 0x00D994 },
+ { "America/Lower_Princes" , 0x00DD89 },
+ { "America/Maceio" , 0x00DDEF },
+ { "America/Managua" , 0x00DF29 },
+ { "America/Manaus" , 0x00DFDC },
+ { "America/Marigot" , 0x00E0DE },
+ { "America/Martinique" , 0x00E133 },
+ { "America/Matamoros" , 0x00E19F },
+ { "America/Mazatlan" , 0x00E3F8 },
+ { "America/Mendoza" , 0x00E665 },
+ { "America/Menominee" , 0x00E819 },
+ { "America/Merida" , 0x00EB9A },
+ { "America/Metlakatla" , 0x00EDD5 },
+ { "America/Mexico_City" , 0x00EF10 },
+ { "America/Miquelon" , 0x00F18B },
+ { "America/Moncton" , 0x00F3FD },
+ { "America/Monterrey" , 0x00F894 },
+ { "America/Montevideo" , 0x00FAF7 },
+ { "America/Montreal" , 0x00FE09 },
+ { "America/Montserrat" , 0x0102F9 },
+ { "America/Nassau" , 0x01034E },
+ { "America/New_York" , 0x010693 },
+ { "America/Nipigon" , 0x010B9E },
+ { "America/Nome" , 0x010EEF },
+ { "America/Noronha" , 0x01126D },
+ { "America/North_Dakota/Beulah" , 0x01139D },
+ { "America/North_Dakota/Center" , 0x011731 },
+ { "America/North_Dakota/New_Salem" , 0x011AC5 },
+ { "America/Ojinaga" , 0x011E6E },
+ { "America/Panama" , 0x0120CF },
+ { "America/Pangnirtung" , 0x012124 },
+ { "America/Paramaribo" , 0x01245A },
+ { "America/Phoenix" , 0x0124EC },
+ { "America/Port-au-Prince" , 0x0125AA },
+ { "America/Port_of_Spain" , 0x0128CE },
+ { "America/Porto_Acre" , 0x0127CA },
+ { "America/Porto_Velho" , 0x012923 },
+ { "America/Puerto_Rico" , 0x012A19 },
+ { "America/Rainy_River" , 0x012A84 },
+ { "America/Rankin_Inlet" , 0x012DBC },
+ { "America/Recife" , 0x0130A2 },
+ { "America/Regina" , 0x0131CC },
+ { "America/Resolute" , 0x01338A },
+ { "America/Rio_Branco" , 0x013672 },
+ { "America/Rosario" , 0x01377A },
+ { "America/Santa_Isabel" , 0x013920 },
+ { "America/Santarem" , 0x013CC3 },
+ { "America/Santiago" , 0x013DC8 },
+ { "America/Santo_Domingo" , 0x014171 },
+ { "America/Sao_Paulo" , 0x014237 },
+ { "America/Scoresbysund" , 0x014546 },
+ { "America/Shiprock" , 0x014834 },
+ { "America/Sitka" , 0x014BAD },
+ { "America/St_Barthelemy" , 0x014F35 },
+ { "America/St_Johns" , 0x014F8A },
+ { "America/St_Kitts" , 0x0154DD },
+ { "America/St_Lucia" , 0x015532 },
+ { "America/St_Thomas" , 0x015587 },
+ { "America/St_Vincent" , 0x0155DC },
+ { "America/Swift_Current" , 0x015631 },
+ { "America/Tegucigalpa" , 0x015752 },
+ { "America/Thule" , 0x0157D1 },
+ { "America/Thunder_Bay" , 0x015A18 },
+ { "America/Tijuana" , 0x015D61 },
+ { "America/Toronto" , 0x0160FA },
+ { "America/Tortola" , 0x01661A },
+ { "America/Vancouver" , 0x01666F },
+ { "America/Virgin" , 0x016AAC },
+ { "America/Whitehorse" , 0x016B01 },
+ { "America/Winnipeg" , 0x016E1E },
+ { "America/Yakutat" , 0x01725E },
+ { "America/Yellowknife" , 0x0175C9 },
+ { "Antarctica/Casey" , 0x0178D9 },
+ { "Antarctica/Davis" , 0x017977 },
+ { "Antarctica/DumontDUrville" , 0x017A18 },
+ { "Antarctica/Macquarie" , 0x017AA9 },
+ { "Antarctica/Mawson" , 0x017CF6 },
+ { "Antarctica/McMurdo" , 0x017D72 },
+ { "Antarctica/Palmer" , 0x01811D },
+ { "Antarctica/Rothera" , 0x018439 },
+ { "Antarctica/South_Pole" , 0x0184AF },
+ { "Antarctica/Syowa" , 0x01882D },
+ { "Antarctica/Troll" , 0x01889B },
+ { "Antarctica/Vostok" , 0x018A6D },
+ { "Arctic/Longyearbyen" , 0x018ADE },
+ { "Asia/Aden" , 0x018E10 },
+ { "Asia/Almaty" , 0x018E65 },
+ { "Asia/Amman" , 0x018FE4 },
+ { "Asia/Anadyr" , 0x01929A },
+ { "Asia/Aqtau" , 0x01949C },
+ { "Asia/Aqtobe" , 0x01969B },
+ { "Asia/Ashgabat" , 0x019853 },
+ { "Asia/Ashkhabad" , 0x019970 },
+ { "Asia/Baghdad" , 0x019A8D },
+ { "Asia/Bahrain" , 0x019C02 },
+ { "Asia/Baku" , 0x019C68 },
+ { "Asia/Bangkok" , 0x019F50 },
+ { "Asia/Beirut" , 0x019FA5 },
+ { "Asia/Bishkek" , 0x01A2B2 },
+ { "Asia/Brunei" , 0x01A45E },
+ { "Asia/Calcutta" , 0x01A4C0 },
+ { "Asia/Chita" , 0x01A539 },
+ { "Asia/Choibalsan" , 0x01A74E },
+ { "Asia/Chongqing" , 0x01A8C7 },
+ { "Asia/Chungking" , 0x01A967 },
+ { "Asia/Colombo" , 0x01AA07 },
+ { "Asia/Dacca" , 0x01AAA3 },
+ { "Asia/Damascus" , 0x01AB49 },
+ { "Asia/Dhaka" , 0x01AE99 },
+ { "Asia/Dili" , 0x01AF3F },
+ { "Asia/Dubai" , 0x01AFC9 },
+ { "Asia/Dushanbe" , 0x01B01E },
+ { "Asia/Gaza" , 0x01B121 },
+ { "Asia/Harbin" , 0x01B474 },
+ { "Asia/Hebron" , 0x01B514 },
+ { "Asia/Ho_Chi_Minh" , 0x01B870 },
+ { "Asia/Hong_Kong" , 0x01B8E8 },
+ { "Asia/Hovd" , 0x01BAAA },
+ { "Asia/Irkutsk" , 0x01BC22 },
+ { "Asia/Istanbul" , 0x01BE0D },
+ { "Asia/Jakarta" , 0x01C1FA },
+ { "Asia/Jayapura" , 0x01C2A4 },
+ { "Asia/Jerusalem" , 0x01C341 },
+ { "Asia/Kabul" , 0x01C670 },
+ { "Asia/Kamchatka" , 0x01C6C1 },
+ { "Asia/Karachi" , 0x01C8BA },
+ { "Asia/Kashgar" , 0x01C96F },
+ { "Asia/Kathmandu" , 0x01C9C4 },
+ { "Asia/Katmandu" , 0x01CA2A },
+ { "Asia/Khandyga" , 0x01CA90 },
+ { "Asia/Kolkata" , 0x01CCBA },
+ { "Asia/Krasnoyarsk" , 0x01CD33 },
+ { "Asia/Kuala_Lumpur" , 0x01CF20 },
+ { "Asia/Kuching" , 0x01CFDD },
+ { "Asia/Kuwait" , 0x01D0CB },
+ { "Asia/Macao" , 0x01D120 },
+ { "Asia/Macau" , 0x01D25B },
+ { "Asia/Magadan" , 0x01D396 },
+ { "Asia/Makassar" , 0x01D59A },
+ { "Asia/Manila" , 0x01D65F },
+ { "Asia/Muscat" , 0x01D6E4 },
+ { "Asia/Nicosia" , 0x01D739 },
+ { "Asia/Novokuznetsk" , 0x01DA21 },
+ { "Asia/Novosibirsk" , 0x01DC41 },
+ { "Asia/Omsk" , 0x01DE31 },
+ { "Asia/Oral" , 0x01E01D },
+ { "Asia/Phnom_Penh" , 0x01E1ED },
+ { "Asia/Pontianak" , 0x01E265 },
+ { "Asia/Pyongyang" , 0x01E327 },
+ { "Asia/Qatar" , 0x01E3B7 },
+ { "Asia/Qyzylorda" , 0x01E41D },
+ { "Asia/Rangoon" , 0x01E5F3 },
+ { "Asia/Riyadh" , 0x01E66B },
+ { "Asia/Saigon" , 0x01E6C0 },
+ { "Asia/Sakhalin" , 0x01E738 },
+ { "Asia/Samarkand" , 0x01E935 },
+ { "Asia/Seoul" , 0x01EA6B },
+ { "Asia/Shanghai" , 0x01EB32 },
+ { "Asia/Singapore" , 0x01EBDE },
+ { "Asia/Srednekolymsk" , 0x01EC95 },
+ { "Asia/Taipei" , 0x01EE95 },
+ { "Asia/Tashkent" , 0x01EFC6 },
+ { "Asia/Tbilisi" , 0x01F0F7 },
+ { "Asia/Tehran" , 0x01F2B1 },
+ { "Asia/Tel_Aviv" , 0x01F51F },
+ { "Asia/Thimbu" , 0x01F84E },
+ { "Asia/Thimphu" , 0x01F8B4 },
+ { "Asia/Tokyo" , 0x01F91A },
+ { "Asia/Ujung_Pandang" , 0x01F9A4 },
+ { "Asia/Ulaanbaatar" , 0x01FA21 },
+ { "Asia/Ulan_Bator" , 0x01FB7C },
+ { "Asia/Urumqi" , 0x01FCC9 },
+ { "Asia/Ust-Nera" , 0x01FD2B },
+ { "Asia/Vientiane" , 0x01FF3D },
+ { "Asia/Vladivostok" , 0x01FFB5 },
+ { "Asia/Yakutsk" , 0x02019F },
+ { "Asia/Yekaterinburg" , 0x020389 },
+ { "Asia/Yerevan" , 0x0205AA },
+ { "Atlantic/Azores" , 0x0207AA },
+ { "Atlantic/Bermuda" , 0x020CAD },
+ { "Atlantic/Canary" , 0x020F8E },
+ { "Atlantic/Cape_Verde" , 0x021264 },
+ { "Atlantic/Faeroe" , 0x0212DD },
+ { "Atlantic/Faroe" , 0x021581 },
+ { "Atlantic/Jan_Mayen" , 0x021825 },
+ { "Atlantic/Madeira" , 0x021B57 },
+ { "Atlantic/Reykjavik" , 0x022060 },
+ { "Atlantic/South_Georgia" , 0x022219 },
+ { "Atlantic/St_Helena" , 0x02242B },
+ { "Atlantic/Stanley" , 0x02225D },
+ { "Australia/ACT" , 0x022480 },
+ { "Australia/Adelaide" , 0x0227A3 },
+ { "Australia/Brisbane" , 0x022AD5 },
+ { "Australia/Broken_Hill" , 0x022BA2 },
+ { "Australia/Canberra" , 0x022EE6 },
+ { "Australia/Currie" , 0x023209 },
+ { "Australia/Darwin" , 0x023542 },
+ { "Australia/Eucla" , 0x0235CE },
+ { "Australia/Hobart" , 0x0236AA },
+ { "Australia/LHI" , 0x023A0E },
+ { "Australia/Lindeman" , 0x023CAF },
+ { "Australia/Lord_Howe" , 0x023D96 },
+ { "Australia/Melbourne" , 0x024047 },
+ { "Australia/North" , 0x024372 },
+ { "Australia/NSW" , 0x0243EC },
+ { "Australia/Perth" , 0x02470F },
+ { "Australia/Queensland" , 0x0247ED },
+ { "Australia/South" , 0x02489F },
+ { "Australia/Sydney" , 0x024BC2 },
+ { "Australia/Tasmania" , 0x024F05 },
+ { "Australia/Victoria" , 0x025250 },
+ { "Australia/West" , 0x025573 },
+ { "Australia/Yancowinna" , 0x02562F },
+ { "Brazil/Acre" , 0x025957 },
+ { "Brazil/DeNoronha" , 0x025A5B },
+ { "Brazil/East" , 0x025B7B },
+ { "Brazil/West" , 0x025E58 },
+ { "Canada/Atlantic" , 0x025F50 },
+ { "Canada/Central" , 0x026438 },
+ { "Canada/East-Saskatchewan" , 0x026D42 },
+ { "Canada/Eastern" , 0x026852 },
+ { "Canada/Mountain" , 0x026ECB },
+ { "Canada/Newfoundland" , 0x027241 },
+ { "Canada/Pacific" , 0x02776C },
+ { "Canada/Saskatchewan" , 0x027B85 },
+ { "Canada/Yukon" , 0x027D0E },
+ { "CET" , 0x028011 },
+ { "Chile/Continental" , 0x02831A },
+ { "Chile/EasterIsland" , 0x0286B5 },
+ { "CST6CDT" , 0x0289F7 },
+ { "Cuba" , 0x028D48 },
+ { "EET" , 0x0290BB },
+ { "Egypt" , 0x02936E },
+ { "Eire" , 0x029755 },
+ { "EST" , 0x029C66 },
+ { "EST5EDT" , 0x029CAA },
+ { "Etc/GMT" , 0x029FFB },
+ { "Etc/GMT+0" , 0x02A0C7 },
+ { "Etc/GMT+1" , 0x02A151 },
+ { "Etc/GMT+10" , 0x02A1DE },
+ { "Etc/GMT+11" , 0x02A26C },
+ { "Etc/GMT+12" , 0x02A2FA },
+ { "Etc/GMT+2" , 0x02A415 },
+ { "Etc/GMT+3" , 0x02A4A1 },
+ { "Etc/GMT+4" , 0x02A52D },
+ { "Etc/GMT+5" , 0x02A5B9 },
+ { "Etc/GMT+6" , 0x02A645 },
+ { "Etc/GMT+7" , 0x02A6D1 },
+ { "Etc/GMT+8" , 0x02A75D },
+ { "Etc/GMT+9" , 0x02A7E9 },
+ { "Etc/GMT-0" , 0x02A083 },
+ { "Etc/GMT-1" , 0x02A10B },
+ { "Etc/GMT-10" , 0x02A197 },
+ { "Etc/GMT-11" , 0x02A225 },
+ { "Etc/GMT-12" , 0x02A2B3 },
+ { "Etc/GMT-13" , 0x02A341 },
+ { "Etc/GMT-14" , 0x02A388 },
+ { "Etc/GMT-2" , 0x02A3CF },
+ { "Etc/GMT-3" , 0x02A45B },
+ { "Etc/GMT-4" , 0x02A4E7 },
+ { "Etc/GMT-5" , 0x02A573 },
+ { "Etc/GMT-6" , 0x02A5FF },
+ { "Etc/GMT-7" , 0x02A68B },
+ { "Etc/GMT-8" , 0x02A717 },
+ { "Etc/GMT-9" , 0x02A7A3 },
+ { "Etc/GMT0" , 0x02A03F },
+ { "Etc/Greenwich" , 0x02A82F },
+ { "Etc/UCT" , 0x02A873 },
+ { "Etc/Universal" , 0x02A8B7 },
+ { "Etc/UTC" , 0x02A8FB },
+ { "Etc/Zulu" , 0x02A93F },
+ { "Europe/Amsterdam" , 0x02A983 },
+ { "Europe/Andorra" , 0x02ADC1 },
+ { "Europe/Athens" , 0x02B03D },
+ { "Europe/Belfast" , 0x02B380 },
+ { "Europe/Belgrade" , 0x02B8B7 },
+ { "Europe/Berlin" , 0x02BB80 },
+ { "Europe/Bratislava" , 0x02BEE4 },
+ { "Europe/Brussels" , 0x02C216 },
+ { "Europe/Bucharest" , 0x02C64D },
+ { "Europe/Budapest" , 0x02C977 },
+ { "Europe/Busingen" , 0x02CCE0 },
+ { "Europe/Chisinau" , 0x02CF97 },
+ { "Europe/Copenhagen" , 0x02D325 },
+ { "Europe/Dublin" , 0x02D62F },
+ { "Europe/Gibraltar" , 0x02DB40 },
+ { "Europe/Guernsey" , 0x02DF97 },
+ { "Europe/Helsinki" , 0x02E4CE },
+ { "Europe/Isle_of_Man" , 0x02E784 },
+ { "Europe/Istanbul" , 0x02ECBB },
+ { "Europe/Jersey" , 0x02F0A8 },
+ { "Europe/Kaliningrad" , 0x02F5DF },
+ { "Europe/Kiev" , 0x02F84A },
+ { "Europe/Lisbon" , 0x02FB66 },
+ { "Europe/Ljubljana" , 0x03006A },
+ { "Europe/London" , 0x030333 },
+ { "Europe/Luxembourg" , 0x03086A },
+ { "Europe/Madrid" , 0x030CC0 },
+ { "Europe/Malta" , 0x031086 },
+ { "Europe/Mariehamn" , 0x03143F },
+ { "Europe/Minsk" , 0x0316F5 },
+ { "Europe/Monaco" , 0x031903 },
+ { "Europe/Moscow" , 0x031D3E },
+ { "Europe/Nicosia" , 0x031F98 },
+ { "Europe/Oslo" , 0x032280 },
+ { "Europe/Paris" , 0x0325B2 },
+ { "Europe/Podgorica" , 0x0329F8 },
+ { "Europe/Prague" , 0x032CC1 },
+ { "Europe/Riga" , 0x032FF3 },
+ { "Europe/Rome" , 0x033338 },
+ { "Europe/Samara" , 0x0336FB },
+ { "Europe/San_Marino" , 0x033964 },
+ { "Europe/Sarajevo" , 0x033D27 },
+ { "Europe/Simferopol" , 0x033FF0 },
+ { "Europe/Skopje" , 0x034241 },
+ { "Europe/Sofia" , 0x03450A },
+ { "Europe/Stockholm" , 0x034812 },
+ { "Europe/Tallinn" , 0x034AC1 },
+ { "Europe/Tirane" , 0x034DFB },
+ { "Europe/Tiraspol" , 0x035101 },
+ { "Europe/Uzhgorod" , 0x03548F },
+ { "Europe/Vaduz" , 0x0357A6 },
+ { "Europe/Vatican" , 0x035A55 },
+ { "Europe/Vienna" , 0x035E18 },
+ { "Europe/Vilnius" , 0x036145 },
+ { "Europe/Volgograd" , 0x036484 },
+ { "Europe/Warsaw" , 0x0366A5 },
+ { "Europe/Zagreb" , 0x036A86 },
+ { "Europe/Zaporozhye" , 0x036D4F },
+ { "Europe/Zurich" , 0x037090 },
+ { "Factory" , 0x03733F },
+ { "GB" , 0x0373B0 },
+ { "GB-Eire" , 0x0378E7 },
+ { "GMT" , 0x037E1E },
+ { "GMT+0" , 0x037EEA },
+ { "GMT-0" , 0x037EA6 },
+ { "GMT0" , 0x037E62 },
+ { "Greenwich" , 0x037F2E },
+ { "Hongkong" , 0x037F72 },
+ { "HST" , 0x038134 },
+ { "Iceland" , 0x038178 },
+ { "Indian/Antananarivo" , 0x038331 },
+ { "Indian/Chagos" , 0x0383A5 },
+ { "Indian/Christmas" , 0x038407 },
+ { "Indian/Cocos" , 0x03844B },
+ { "Indian/Comoro" , 0x03848F },
+ { "Indian/Kerguelen" , 0x0384E4 },
+ { "Indian/Mahe" , 0x038539 },
+ { "Indian/Maldives" , 0x03858E },
+ { "Indian/Mauritius" , 0x0385E3 },
+ { "Indian/Mayotte" , 0x038659 },
+ { "Indian/Reunion" , 0x0386AE },
+ { "Iran" , 0x038703 },
+ { "Israel" , 0x038971 },
+ { "Jamaica" , 0x038CA0 },
+ { "Japan" , 0x038D65 },
+ { "Kwajalein" , 0x038DEF },
+ { "Libya" , 0x038E52 },
+ { "MET" , 0x038F5B },
+ { "Mexico/BajaNorte" , 0x039264 },
+ { "Mexico/BajaSur" , 0x0395CD },
+ { "Mexico/General" , 0x039812 },
+ { "MST" , 0x039A70 },
+ { "MST7MDT" , 0x039AB4 },
+ { "Navajo" , 0x039E05 },
+ { "NZ" , 0x03A17E },
+ { "NZ-CHAT" , 0x03A4FC },
+ { "Pacific/Apia" , 0x03A7E0 },
+ { "Pacific/Auckland" , 0x03A97C },
+ { "Pacific/Chatham" , 0x03AD08 },
+ { "Pacific/Chuuk" , 0x03AFFB },
+ { "Pacific/Easter" , 0x03B054 },
+ { "Pacific/Efate" , 0x03B3A3 },
+ { "Pacific/Enderbury" , 0x03B469 },
+ { "Pacific/Fakaofo" , 0x03B4D7 },
+ { "Pacific/Fiji" , 0x03B528 },
+ { "Pacific/Funafuti" , 0x03B6BB },
+ { "Pacific/Galapagos" , 0x03B6FF },
+ { "Pacific/Gambier" , 0x03B777 },
+ { "Pacific/Guadalcanal" , 0x03B7DC },
+ { "Pacific/Guam" , 0x03B831 },
+ { "Pacific/Honolulu" , 0x03B887 },
+ { "Pacific/Johnston" , 0x03B8FE },
+ { "Pacific/Kiritimati" , 0x03B97D },
+ { "Pacific/Kosrae" , 0x03B9E8 },
+ { "Pacific/Kwajalein" , 0x03BA45 },
+ { "Pacific/Majuro" , 0x03BAB1 },
+ { "Pacific/Marquesas" , 0x03BB10 },
+ { "Pacific/Midway" , 0x03BB77 },
+ { "Pacific/Nauru" , 0x03BC01 },
+ { "Pacific/Niue" , 0x03BC79 },
+ { "Pacific/Norfolk" , 0x03BCD7 },
+ { "Pacific/Noumea" , 0x03BD2C },
+ { "Pacific/Pago_Pago" , 0x03BDBC },
+ { "Pacific/Palau" , 0x03BE33 },
+ { "Pacific/Pitcairn" , 0x03BE77 },
+ { "Pacific/Pohnpei" , 0x03BECC },
+ { "Pacific/Ponape" , 0x03BF21 },
+ { "Pacific/Port_Moresby" , 0x03BF66 },
+ { "Pacific/Rarotonga" , 0x03BFAA },
+ { "Pacific/Saipan" , 0x03C086 },
+ { "Pacific/Samoa" , 0x03C0E9 },
+ { "Pacific/Tahiti" , 0x03C160 },
+ { "Pacific/Tarawa" , 0x03C1C5 },
+ { "Pacific/Tongatapu" , 0x03C219 },
+ { "Pacific/Truk" , 0x03C2A5 },
+ { "Pacific/Wake" , 0x03C2EA },
+ { "Pacific/Wallis" , 0x03C33A },
+ { "Pacific/Yap" , 0x03C37E },
+ { "Poland" , 0x03C3C3 },
+ { "Portugal" , 0x03C7A4 },
+ { "PRC" , 0x03CCA0 },
+ { "PST8PDT" , 0x03CD40 },
+ { "ROC" , 0x03D091 },
+ { "ROK" , 0x03D1C2 },
+ { "Singapore" , 0x03D289 },
+ { "Turkey" , 0x03D340 },
+ { "UCT" , 0x03D72D },
+ { "Universal" , 0x03D771 },
+ { "US/Alaska" , 0x03D7B5 },
+ { "US/Aleutian" , 0x03DB1E },
+ { "US/Arizona" , 0x03DE84 },
+ { "US/Central" , 0x03DF12 },
+ { "US/East-Indiana" , 0x03E91C },
+ { "US/Eastern" , 0x03E41D },
+ { "US/Hawaii" , 0x03EB86 },
+ { "US/Indiana-Starke" , 0x03EBF7 },
+ { "US/Michigan" , 0x03EF68 },
+ { "US/Mountain" , 0x03F29F },
+ { "US/Pacific" , 0x03F618 },
+ { "US/Pacific-New" , 0x03FA1D },
+ { "US/Samoa" , 0x03FE22 },
+ { "UTC" , 0x03FE99 },
+ { "W-SU" , 0x040190 },
+ { "WET" , 0x03FEDD },
+ { "Zulu" , 0x0403D3 },
};
/* This is a generated file, do not modify */
-const unsigned char timelib_timezone_db_data_builtin[263151] = {
+const unsigned char timelib_timezone_db_data_builtin[263191] = {
/* Africa/Abidjan */
@@ -698,8 +698,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
/* Africa/Blantyre */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4D, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC3, 0xB0,
-0x01, 0x00, 0x00, 0x20, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4,
+0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x3E, 0xE2, 0x01, 0x48, 0x10,
0x60, 0x00, 0x00, 0x00, 0x00,
@@ -713,10 +713,11 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
/* Africa/Bujumbura */
0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20,
-0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x84, 0x2A, 0xA2, 0x01, 0x3F, 0x77, 0xDA,
-0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4,
+0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x2A, 0xA2, 0x01, 0x3F, 0x77,
+0xDA, 0x00, 0x00, 0x00, 0x00,
/* Africa/Cairo */
0x50, 0x48, 0x50, 0x31, 0x01, 0x45, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -963,18 +964,17 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
/* Africa/Gaborone */
0x50, 0x48, 0x50, 0x31, 0x01, 0x42, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0E, 0x82, 0x46, 0xCF, 0x68,
-0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x15, 0x18, 0x00,
-0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x05, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x09, 0x53, 0x41, 0x53,
-0x54, 0x00, 0x43, 0x41, 0x54, 0x00, 0x43, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x63, 0xB7, 0x57, 0x01, 0x3A, 0x34, 0x32, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4,
+0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0xB7, 0x57, 0x01, 0x3A, 0x34,
+0x32, 0x00, 0x00, 0x00, 0x00,
/* Africa/Harare */
0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC7, 0x64,
-0x01, 0x00, 0x00, 0x1D, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4,
+0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x1E, 0x1A, 0x01, 0x42, 0x09,
0x68, 0x00, 0x00, 0x00, 0x00,
@@ -1040,8 +1040,8 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
/* Africa/Kigali */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0xBE, 0xF1, 0x0E, 0x50,
-0x01, 0x00, 0x00, 0x1C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4,
+0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x86, 0x5A, 0x88, 0x01, 0x40, 0x89,
0x4A, 0x00, 0x00, 0x00, 0x00,
@@ -1088,17 +1088,18 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
/* Africa/Lubumbashi */
0x50, 0x48, 0x50, 0x31, 0x01, 0x43, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x1C, 0x20,
-0x00, 0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x77, 0x86, 0xF5, 0x01, 0x3C, 0x91, 0xAA,
-0x00, 0x00, 0x00, 0x17, 0x65, 0x61, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52, 0x65,
-0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4,
+0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x86, 0xF5, 0x01, 0x3C, 0x91,
+0xAA, 0x00, 0x00, 0x00, 0x17, 0x65, 0x61, 0x73, 0x74, 0x20, 0x44, 0x65, 0x6D, 0x2E, 0x20, 0x52,
+0x65, 0x70, 0x2E, 0x20, 0x6F, 0x66, 0x20, 0x43, 0x6F, 0x6E, 0x67, 0x6F,
/* Africa/Lusaka */
0x50, 0x48, 0x50, 0x31, 0x01, 0x5A, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC9, 0xFC,
-0x01, 0x00, 0x00, 0x1A, 0x84, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x82, 0x46, 0xC5, 0xF4,
+0x01, 0x00, 0x00, 0x1E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
0x00, 0x43, 0x41, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0xCE, 0x1D, 0x01, 0x3D, 0xD0,
0xAD, 0x00, 0x00, 0x00, 0x00,
@@ -1121,19 +1122,20 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
/* Africa/Maseru */
0x50, 0x48, 0x50, 0x31, 0x01, 0x4C, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xCA, 0xB8,
-0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70, 0x01, 0x02, 0x01, 0x00, 0x00, 0x19, 0xC8, 0x00,
-0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x00, 0x00, 0x2A, 0x30, 0x01, 0x04, 0x4C, 0x4D, 0x54,
-0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x5D, 0xD5,
-0x01, 0x3C, 0x9E, 0xB0, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68,
+0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x5C, 0x5D, 0xD5, 0x01, 0x3C, 0x9E, 0xB0, 0x00, 0x00, 0x00, 0x00,
/* Africa/Mbabane */
0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x5A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x82, 0x46, 0xC7, 0x58,
-0x01, 0x00, 0x00, 0x1D, 0x28, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x04, 0x4C, 0x4D, 0x54,
-0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x32, 0xD0, 0x01, 0x42,
-0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x82, 0x46, 0xCF, 0x68,
+0xCC, 0xAE, 0x8C, 0x80, 0xCD, 0x9E, 0x6F, 0x70, 0xCE, 0x8E, 0x6E, 0x80, 0xCF, 0x7E, 0x51, 0x70,
+0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x15, 0x18, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x30, 0x01,
+0x00, 0x00, 0x00, 0x1C, 0x20, 0x00, 0x00, 0x53, 0x41, 0x53, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x61, 0x32, 0xD0, 0x01, 0x42, 0x1C, 0xF0, 0x00, 0x00, 0x00, 0x00,
/* Africa/Mogadishu */
0x50, 0x48, 0x50, 0x31, 0x01, 0x53, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -4056,7 +4058,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
0x50, 0x48, 0x50, 0x31, 0x01, 0x4A, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF,
-0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60,
+0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60,
0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0,
0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0,
0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0,
@@ -8909,7 +8911,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
/* Asia/Novokuznetsk */
0x50, 0x48, 0x50, 0x31, 0x01, 0x52, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00,
-0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xA1, 0xF9, 0x13, 0x40,
+0x00, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x1A, 0xAA, 0x18, 0x20, 0xC0,
0xB5, 0xA3, 0xE1, 0x20, 0x15, 0x27, 0x6F, 0x90, 0x16, 0x18, 0xA4, 0x00, 0x17, 0x08, 0xA3, 0x10,
0x17, 0xF9, 0xD7, 0x80, 0x18, 0xE9, 0xD6, 0x90, 0x19, 0xDB, 0x0B, 0x00, 0x1A, 0xCC, 0x5B, 0x90,
0x1B, 0xBC, 0x68, 0xB0, 0x1C, 0xAC, 0x59, 0xB0, 0x1D, 0x9C, 0x4A, 0xB0, 0x1E, 0x8C, 0x3B, 0xB0,
@@ -8934,7 +8936,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00, 0x00, 0x62, 0x70, 0x00, 0x04, 0x00,
0x00, 0x70, 0x80, 0x01, 0x09, 0x00, 0x00, 0x62, 0x70, 0x01, 0x09, 0x00, 0x00, 0x54, 0x60, 0x00,
0x04, 0x00, 0x00, 0x62, 0x70, 0x01, 0x0F, 0x00, 0x00, 0x54, 0x60, 0x00, 0x15, 0x00, 0x00, 0x62,
-0x70, 0x00, 0x15, 0x4E, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x53,
+0x70, 0x00, 0x15, 0x4C, 0x4D, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x54, 0x00, 0x4B, 0x52, 0x41, 0x53,
0x54, 0x00, 0x4E, 0x4F, 0x56, 0x53, 0x54, 0x00, 0x4E, 0x4F, 0x56, 0x54, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xDB, 0x58, 0x58, 0x01, 0x97, 0x96, 0x72, 0x00, 0x00, 0x00, 0x31, 0x4D,
@@ -16412,7 +16414,7 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
0x50, 0x48, 0x50, 0x31, 0x00, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0C, 0x93, 0x0F, 0xB4, 0xFF,
-0x08, 0x20, 0xC1, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60,
+0x07, 0x8D, 0x19, 0x70, 0x09, 0x10, 0xA4, 0x60, 0x09, 0xAD, 0x94, 0xF0, 0x0A, 0xF0, 0x86, 0x60,
0x0B, 0xE0, 0x85, 0x70, 0x0C, 0xD9, 0xA2, 0xE0, 0x0D, 0xC0, 0x67, 0x70, 0x0E, 0xB9, 0x84, 0xE0,
0x0F, 0xA9, 0x83, 0xF0, 0x10, 0x99, 0x66, 0xE0, 0x11, 0x89, 0x65, 0xF0, 0x12, 0x79, 0x48, 0xE0,
0x13, 0x69, 0x47, 0xF0, 0x14, 0x59, 0x2A, 0xE0, 0x15, 0x49, 0x29, 0xF0, 0x16, 0x39, 0x0C, 0xE0,
@@ -18530,4 +18532,4 @@ const unsigned char timelib_timezone_db_data_builtin[263151] = {
0x00, 0x00, 0x55, 0x54, 0x43, 0x00, 0x00, 0x00, 0x00, 0x89, 0x54, 0x40, 0x01, 0x12, 0xA8, 0x80,
0x00, 0x00, 0x00, 0x00, };
-const timelib_tzdb timezonedb_builtin = { "2014.7", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
+const timelib_tzdb timezonedb_builtin = { "2014.8", 582, timezonedb_idx_builtin, timelib_timezone_db_data_builtin };
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 64a40a21e4..bf29a56068 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -330,7 +330,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_offset_get, 0, 0, 2)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_offset_get, 0, 0, 1)
- ZEND_ARG_INFO(0, datetime)
+ ZEND_ARG_INFO(0, object)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_transitions_get, 0, 0, 1)
@@ -3848,7 +3848,7 @@ PHP_FUNCTION(timezone_name_from_abbr)
}
/* }}} */
-/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTime object)
+/* {{{ proto long timezone_offset_get(DateTimeZone object, DateTimeInterface object)
Returns the timezone offset.
*/
PHP_FUNCTION(timezone_offset_get)
@@ -3858,13 +3858,13 @@ PHP_FUNCTION(timezone_offset_get)
php_date_obj *dateobj;
timelib_time_offset *offset;
- if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_date) == FAILURE) {
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC, getThis(), "OO", &object, date_ce_timezone, &dateobject, date_ce_interface) == FAILURE) {
RETURN_FALSE;
}
tzobj = (php_timezone_obj *) zend_object_store_get_object(object TSRMLS_CC);
DATE_CHECK_INITIALIZED(tzobj->initialized, DateTimeZone);
dateobj = (php_date_obj *) zend_object_store_get_object(dateobject TSRMLS_CC);
- DATE_CHECK_INITIALIZED(dateobj->time, DateTime);
+ DATE_CHECK_INITIALIZED(dateobj->time, DateTimeInterface);
switch (tzobj->type) {
case TIMELIB_ZONETYPE_ID:
diff --git a/ext/date/tests/68062.phpt b/ext/date/tests/68062.phpt
new file mode 100644
index 0000000000..ce2105abae
--- /dev/null
+++ b/ext/date/tests/68062.phpt
@@ -0,0 +1,13 @@
+--TEST--
+DateTimeZone::getOffset() accepts a DateTimeInterface object
+--FILE--
+<?php
+
+$tz = new DateTimeZone('Europe/London');
+$dt = new DateTimeImmutable('2014-09-20', $tz);
+
+echo $tz->getOffset($dt);
+echo $tz->getOffset(1);
+--EXPECTF--
+3600
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s
diff --git a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt
index a86d5e10bb..ecd99d5bc3 100644
--- a/ext/date/tests/DateTimeZone_getOffset_variation1.phpt
+++ b/ext/date/tests/DateTimeZone_getOffset_variation1.phpt
@@ -112,141 +112,141 @@ fclose( $file_handle );
-- int 0 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
bool(false)
-- int 1 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
bool(false)
-- int 12345 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
bool(false)
-- int -12345 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, integer given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, integer given in %s on line %d
bool(false)
-- float 10.5 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d
bool(false)
-- float -10.5 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d
bool(false)
-- float .5 --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, double given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, double given in %s on line %d
bool(false)
-- empty array --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
bool(false)
-- int indexed array --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
bool(false)
-- associative array --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
bool(false)
-- nested arrays --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, array given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, array given in %s on line %d
bool(false)
-- uppercase NULL --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
bool(false)
-- lowercase null --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
bool(false)
-- lowercase true --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
bool(false)
-- lowercase false --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
bool(false)
-- uppercase TRUE --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
bool(false)
-- uppercase FALSE --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, boolean given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, boolean given in %s on line %d
bool(false)
-- empty string DQ --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- empty string SQ --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- string DQ --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- string SQ --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- mixed case string --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- heredoc --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, string given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- instance of classWithToString --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
bool(false)
-- instance of classWithoutToString --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, object given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, object given in %s on line %d
bool(false)
-- undefined var --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
bool(false)
-- unset var --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, null given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, null given in %s on line %d
bool(false)
-- resource --
-Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTime, resource given in %s on line %d
+Warning: DateTimeZone::getOffset() expects parameter 1 to be DateTimeInterface, resource given in %s on line %d
bool(false)
===DONE===
diff --git a/ext/date/tests/timezone_offset_get_error.phpt b/ext/date/tests/timezone_offset_get_error.phpt
index b8ca2c1c15..c9fa25ce97 100644
--- a/ext/date/tests/timezone_offset_get_error.phpt
+++ b/ext/date/tests/timezone_offset_get_error.phpt
@@ -73,12 +73,12 @@ bool(false)
-- Testing timezone_offset_get() function with an invalid values for $datetime argument --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d
bool(false)
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
bool(false)
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
bool(false)
===DONE===
diff --git a/ext/date/tests/timezone_offset_get_variation2.phpt b/ext/date/tests/timezone_offset_get_variation2.phpt
index 93311f3a6b..c83b697498 100644
--- a/ext/date/tests/timezone_offset_get_variation2.phpt
+++ b/ext/date/tests/timezone_offset_get_variation2.phpt
@@ -112,141 +112,141 @@ fclose( $file_handle );
-- int 0 --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
bool(false)
-- int 1 --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
bool(false)
-- int 12345 --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
bool(false)
-- int -12345 --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, integer given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, integer given in %s on line %d
bool(false)
-- float 10.5 --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d
bool(false)
-- float -10.5 --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d
bool(false)
-- float .5 --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, double given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, double given in %s on line %d
bool(false)
-- empty array --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
bool(false)
-- int indexed array --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
bool(false)
-- associative array --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
bool(false)
-- nested arrays --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, array given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, array given in %s on line %d
bool(false)
-- uppercase NULL --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
bool(false)
-- lowercase null --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
bool(false)
-- lowercase true --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
bool(false)
-- lowercase false --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
bool(false)
-- uppercase TRUE --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
bool(false)
-- uppercase FALSE --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, boolean given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, boolean given in %s on line %d
bool(false)
-- empty string DQ --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- empty string SQ --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- string DQ --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- string SQ --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- mixed case string --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- heredoc --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, string given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, string given in %s on line %d
bool(false)
-- instance of classWithToString --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d
bool(false)
-- instance of classWithoutToString --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, object given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, object given in %s on line %d
bool(false)
-- undefined var --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
bool(false)
-- unset var --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, null given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, null given in %s on line %d
bool(false)
-- resource --
-Warning: timezone_offset_get() expects parameter 2 to be DateTime, resource given in %s on line %d
+Warning: timezone_offset_get() expects parameter 2 to be DateTimeInterface, resource given in %s on line %d
bool(false)
===DONE===
diff --git a/ext/dom/dom_properties.h b/ext/dom/dom_properties.h
index a658b1d843..9d82d0e860 100644
--- a/ext/dom/dom_properties.h
+++ b/ext/dom/dom_properties.h
@@ -137,6 +137,8 @@ int dom_node_text_content_write(dom_object *obj, zval *newval TSRMLS_DC);
/* nodelist properties */
int dom_nodelist_length_read(dom_object *obj, zval **retval TSRMLS_DC);
+xmlNodePtr dom_nodelist_xml_item(dom_nnodemap_object *objmap, long index);
+xmlNodePtr dom_nodelist_baseobj_item(dom_nnodemap_object *objmap, long index);
/* notation properties */
int dom_notation_public_id_read(dom_object *obj, zval **retval TSRMLS_DC);
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index a9621eeb4c..4e035c7640 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -72,6 +72,7 @@ zend_class_entry *dom_namespace_node_class_entry;
/* }}} */
zend_object_handlers dom_object_handlers;
+zend_object_handlers dom_nnodemap_object_handlers;
static HashTable classes;
/* {{{ prop handler tables */
@@ -668,6 +669,10 @@ PHP_MINIT_FUNCTION(dom)
dom_object_handlers.has_property = dom_property_exists;
dom_object_handlers.get_debug_info = dom_get_debug_info;
+ memcpy(&dom_nnodemap_object_handlers, &dom_object_handlers, sizeof(zend_object_handlers));
+ dom_nnodemap_object_handlers.read_dimension = dom_nodelist_read_dimension;
+ dom_nnodemap_object_handlers.has_dimension = dom_nodelist_has_dimension;
+
zend_hash_init(&classes, 0, NULL, NULL, 1);
INIT_CLASS_ENTRY(ce, "DOMException", php_dom_domexception_class_functions);
@@ -1297,7 +1302,7 @@ zend_object_value dom_nnodemap_objects_new(zend_class_entry *class_type TSRMLS_D
retval.handle = zend_objects_store_put(intern, dom_nnodemap_object_dtor, (zend_objects_free_object_storage_t)dom_nnodemap_objects_free_storage, dom_objects_clone TSRMLS_CC);
intern->handle = retval.handle;
- retval.handlers = dom_get_obj_handlers(TSRMLS_C);
+ retval.handlers = &dom_nnodemap_object_handlers;
return retval;
}
@@ -1674,6 +1679,54 @@ xmlNsPtr dom_get_nsdecl(xmlNode *node, xmlChar *localName) {
}
/* }}} end dom_get_nsdecl */
+static inline long dom_get_long(zval *offset) /* {{{ */
+{
+ if (Z_TYPE_P(offset) == IS_LONG) {
+ return Z_LVAL_P(offset);
+ } else {
+ zval tmp;
+
+ MAKE_COPY_ZVAL(&offset, &tmp);
+ convert_to_long(&tmp);
+
+ return Z_LVAL(tmp);
+ }
+}
+/* }}} */
+
+zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type TSRMLS_DC) /* {{{ */
+{
+ zval *rv, offset_copy = zval_used_for_init;
+
+ if (!offset) {
+ return NULL;
+ }
+
+ ZVAL_LONG(&offset_copy, dom_get_long(offset));
+
+ zend_call_method_with_1_params(&object, Z_OBJCE_P(object), NULL, "item", &rv, &offset_copy);
+
+ Z_DELREF_P(rv);
+
+ return rv;
+} /* }}} end dom_nodelist_read_dimension */
+
+int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC)
+{
+ long offset = dom_get_long(member);
+
+ if (offset < 0) {
+ return 0;
+ } else {
+ zval *length = zend_read_property(Z_OBJCE_P(object), object, "length", sizeof("length") - 1, 0 TSRMLS_CC);
+ int ret = length && offset < Z_LVAL_P(length);
+
+ FREE_ZVAL(length);
+
+ return ret;
+ }
+} /* }}} end dom_nodelist_has_dimension */
+
#endif /* HAVE_DOM */
/*
diff --git a/ext/dom/php_dom.h b/ext/dom/php_dom.h
index f5f0bc6a72..6f0d9b80c1 100644
--- a/ext/dom/php_dom.h
+++ b/ext/dom/php_dom.h
@@ -123,6 +123,8 @@ xmlNode *php_dom_libxml_hash_iter(xmlHashTable *ht, int index);
xmlNode *php_dom_libxml_notation_iter(xmlHashTable *ht, int index);
zend_object_iterator *php_dom_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC);
int dom_set_doc_classmap(php_libxml_ref_obj *document, zend_class_entry *basece, zend_class_entry *ce TSRMLS_DC);
+zval *dom_nodelist_read_dimension(zval *object, zval *offset, int type TSRMLS_DC);
+int dom_nodelist_has_dimension(zval *object, zval *member, int check_empty TSRMLS_DC);
#define REGISTER_DOM_CLASS(ce, name, parent_ce, funcs, entry) \
INIT_CLASS_ENTRY(ce, name, funcs); \
diff --git a/ext/dom/tests/bug67949.phpt b/ext/dom/tests/bug67949.phpt
new file mode 100644
index 0000000000..e4eb6f724f
--- /dev/null
+++ b/ext/dom/tests/bug67949.phpt
@@ -0,0 +1,87 @@
+--TEST--
+Bug #67949: DOMNodeList elements should be accessible through array notation
+--FILE--
+<?php
+
+$html = <<<HTML
+<div>data</div>
+<a href="test">hello world</a>
+HTML;
+$doc = new DOMDocument;
+$doc->loadHTML($html);
+
+$nodes = $doc->getElementsByTagName('div');
+
+echo "testing has_dimension\n";
+var_dump(isset($nodes[0]));
+var_dump(isset($nodes[1]));
+var_dump(isset($nodes[-1]));
+
+echo "testing property access\n";
+var_dump($nodes[0]->textContent);
+var_dump($nodes[1]->textContent);
+
+echo "testing offset not a long\n";
+$offset = ['test'];
+var_dump($offset);
+var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent);
+var_dump($offset);
+
+$something = 'test';
+$offset = &$something;
+
+var_dump($offset);
+var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent);
+var_dump($offset);
+
+$offset = 'test';
+var_dump($offset);
+var_dump(isset($nodes[$offset]), $nodes[$offset]->textContent);
+var_dump($offset);
+
+echo "testing read_dimension with null offset\n";
+var_dump($nodes[][] = 1);
+
+echo "testing attribute access\n";
+$anchor = $doc->getElementsByTagName('a')[0];
+var_dump($anchor->attributes[0]->name);
+
+echo "==DONE==\n";
+
+--EXPECTF--
+testing has_dimension
+bool(true)
+bool(false)
+bool(false)
+testing property access
+string(4) "data"
+
+Notice: Trying to get property of non-object in %s on line %d
+NULL
+testing offset not a long
+array(1) {
+ [0]=>
+ string(4) "test"
+}
+
+Notice: Trying to get property of non-object in %s on line %d
+bool(false)
+NULL
+array(1) {
+ [0]=>
+ string(4) "test"
+}
+string(4) "test"
+bool(true)
+string(4) "data"
+string(4) "test"
+string(4) "test"
+bool(true)
+string(4) "data"
+string(4) "test"
+testing read_dimension with null offset
+NULL
+testing attribute access
+string(4) "href"
+==DONE==
+
diff --git a/ext/exif/exif.c b/ext/exif/exif.c
index 0b28f1c260..ab2a504351 100644
--- a/ext/exif/exif.c
+++ b/ext/exif/exif.c
@@ -2416,11 +2416,11 @@ static void* exif_ifd_make_value(image_info_data *info_data, int motorola_intel
data_ptr += 8;
break;
case TAG_FMT_SINGLE:
- memmove(data_ptr, &info_data->value.f, byte_count);
+ memmove(data_ptr, &info_value->f, 4);
data_ptr += 4;
break;
case TAG_FMT_DOUBLE:
- memmove(data_ptr, &info_data->value.d, byte_count);
+ memmove(data_ptr, &info_value->d, 8);
data_ptr += 8;
break;
}
diff --git a/ext/exif/tests/bug68113.jpg b/ext/exif/tests/bug68113.jpg
new file mode 100755
index 0000000000..3ce7a620fb
--- /dev/null
+++ b/ext/exif/tests/bug68113.jpg
Binary files differ
diff --git a/ext/exif/tests/bug68113.phpt b/ext/exif/tests/bug68113.phpt
new file mode 100644
index 0000000000..0fa4c4aca8
--- /dev/null
+++ b/ext/exif/tests/bug68113.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Bug #68113 (Heap corruption in exif_thumbnail())
+--SKIPIF--
+<?php
+extension_loaded("exif") or die("skip need exif");
+?>
+--FILE--
+<?php
+var_dump(exif_thumbnail(__DIR__."/bug68113.jpg"));
+?>
+Done
+--EXPECTF--
+Warning: exif_thumbnail(bug68113.jpg): File structure corrupted in %s/bug68113.php on line 2
+
+Warning: exif_thumbnail(bug68113.jpg): Invalid JPEG file in %s/bug68113.php on line 2
+bool(false)
+Done \ No newline at end of file
diff --git a/ext/ext_skel b/ext/ext_skel
index e6b01fd4fc..c0c398d15e 100755
--- a/ext/ext_skel
+++ b/ext/ext_skel
@@ -156,12 +156,12 @@ if test "\$PHP_$EXTNAME" != "no"; then
dnl PHP_CHECK_LIBRARY(\$LIBNAME,\$LIBSYMBOL,
dnl [
- dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/lib, ${EXTNAME}_SHARED_LIBADD)
+ dnl PHP_ADD_LIBRARY_WITH_PATH(\$LIBNAME, \$${EXTNAME}_DIR/\$PHP_LIBDIR, ${EXTNAME}_SHARED_LIBADD)
dnl AC_DEFINE(HAVE_${EXTNAME}LIB,1,[ ])
dnl ],[
dnl AC_MSG_ERROR([wrong $extname lib version or lib not found])
dnl ],[
- dnl -L\$${EXTNAME}_DIR/lib -lm
+ dnl -L\$${EXTNAME}_DIR/\$PHP_LIBDIR -lm
dnl ])
dnl
dnl PHP_SUBST(${EXTNAME}_SHARED_LIBADD)
diff --git a/ext/fileinfo/libmagic/apprentice.c b/ext/fileinfo/libmagic/apprentice.c
index ce747378aa..543bce5088 100644
--- a/ext/fileinfo/libmagic/apprentice.c
+++ b/ext/fileinfo/libmagic/apprentice.c
@@ -1272,7 +1272,7 @@ file_signextend(struct magic_set *ms, struct magic *m, uint64_t v)
* the sign extension must have happened.
*/
case FILE_BYTE:
- v = (char) v;
+ v = (signed char) v;
break;
case FILE_SHORT:
case FILE_BESHORT:
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index f67e80bf8e..7bf0b757a9 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -5118,11 +5118,23 @@ PHP_FUNCTION(imagescale)
return;
}
method = tmp_m;
- new_width = tmp_w;
- new_height = tmp_h;
ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd);
+ if (tmp_h < 0) {
+ /* preserve ratio */
+ long src_x, src_y;
+
+ src_x = gdImageSX(im);
+ src_y = gdImageSY(im);
+ if (src_x) {
+ tmp_h = tmp_w * src_y / src_x;
+ }
+ }
+
+ new_width = tmp_w;
+ new_height = tmp_h;
+
if (gdImageSetInterpolationMethod(im, method)) {
im_scaled = gdImageScale(im, new_width, new_height);
}
diff --git a/ext/gd/tests/bug48801_1.phpt b/ext/gd/tests/bug48801_1.phpt
index ef2aa1dba7..0ab6d7cdd9 100644
--- a/ext/gd/tests/bug48801_1.phpt
+++ b/ext/gd/tests/bug48801_1.phpt
@@ -1,13 +1,12 @@
--TEST--
-Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10 and < 2.4.12
+Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.10
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
include dirname(__FILE__) . '/func.inc';
- if(version_compare(get_freetype_version(), '2.4.10') < 0) die('skip for freetype >= 2.4.10');
- if(version_compare(get_freetype_version(), '2.4.12') >= 0) die('skip for freetype < 2.4.12');
+ if(version_compare(get_freetype_version(), '2.4.10') == -1) die('skip for freetype >= 2.4.10');
?>
--FILE--
<?php
@@ -21,6 +20,6 @@ echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
?>
--EXPECTF--
(-1, 15)
-(156, 15)
-(156, -48)
+(15%d, 15)
+(15%d, -48)
(-1, -48)
diff --git a/ext/gd/tests/bug48801_2.phpt b/ext/gd/tests/bug48801_2.phpt
deleted file mode 100644
index b2a719fa02..0000000000
--- a/ext/gd/tests/bug48801_2.phpt
+++ /dev/null
@@ -1,25 +0,0 @@
---TEST--
-Bug #48801 (Problem with imagettfbbox) freetype >= 2.4.12
---SKIPIF--
-<?php
- if(!extension_loaded('gd')){ die('skip gd extension not available'); }
- if(!function_exists('imageftbbox')) die('skip imageftbbox() not available');
-
- include dirname(__FILE__) . '/func.inc';
- if(version_compare(get_freetype_version(), '2.4.12') < 0) die('skip for freetype >= 2.4.12');
-?>
---FILE--
-<?php
-$cwd = dirname(__FILE__);
-$font = "$cwd/Tuffy.ttf";
-$bbox = imageftbbox(50, 0, $font, "image");
-echo '(' . $bbox[0] . ', ' . $bbox[1] . ")\n";
-echo '(' . $bbox[2] . ', ' . $bbox[3] . ")\n";
-echo '(' . $bbox[4] . ', ' . $bbox[5] . ")\n";
-echo '(' . $bbox[6] . ', ' . $bbox[7] . ")\n";
-?>
---EXPECTF--
-(-1, 15)
-(155, 15)
-(155, -48)
-(-1, -48)
diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c
index bad610c0b4..8aff2d6b23 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -104,6 +104,15 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random, 0, 0, 0)
ZEND_ARG_INFO(0, limiter)
ZEND_END_ARG_INFO()
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random_bits, 0, 0, 1)
+ ZEND_ARG_INFO(0, bits)
+ZEND_END_ARG_INFO()
+
+ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_random_range, 0, 0, 2)
+ ZEND_ARG_INFO(0, min)
+ ZEND_ARG_INFO(0, max)
+ZEND_END_ARG_INFO()
+
ZEND_BEGIN_ARG_INFO_EX(arginfo_gmp_setbit, 0, 0, 2)
ZEND_ARG_INFO(0, a)
ZEND_ARG_INFO(0, index)
@@ -161,6 +170,8 @@ const zend_function_entry gmp_functions[] = {
ZEND_FE(gmp_cmp, arginfo_gmp_binary)
ZEND_FE(gmp_sign, arginfo_gmp_unary)
ZEND_FE(gmp_random, arginfo_gmp_random)
+ ZEND_FE(gmp_random_bits, arginfo_gmp_random_bits)
+ ZEND_FE(gmp_random_range, arginfo_gmp_random_range)
ZEND_FE(gmp_and, arginfo_gmp_binary)
ZEND_FE(gmp_or, arginfo_gmp_binary)
ZEND_FE(gmp_com, arginfo_gmp_unary)
@@ -1784,6 +1795,22 @@ ZEND_FUNCTION(gmp_sign)
}
/* }}} */
+static void gmp_init_random(TSRMLS_D)
+{
+ if (!GMPG(rand_initialized)) {
+ /* Initialize */
+#if GMP_42_OR_NEWER
+ gmp_randinit_mt(GMPG(rand_state));
+#else
+ gmp_randinit_lc_2exp(GMPG(rand_state), 32L);
+#endif
+ /* Seed */
+ gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED());
+
+ GMPG(rand_initialized) = 1;
+ }
+}
+
/* {{{ proto GMP gmp_random([int limiter])
Gets random number */
ZEND_FUNCTION(gmp_random)
@@ -1796,16 +1823,8 @@ ZEND_FUNCTION(gmp_random)
}
INIT_GMP_RETVAL(gmpnum_result);
+ gmp_init_random(TSRMLS_C);
- if (!GMPG(rand_initialized)) {
- /* Initialize */
- gmp_randinit_lc_2exp_size(GMPG(rand_state), 32L);
-
- /* Seed */
- gmp_randseed_ui(GMPG(rand_state), GENERATE_SEED());
-
- GMPG(rand_initialized) = 1;
- }
#ifdef GMP_LIMB_BITS
mpz_urandomb(gmpnum_result, GMPG(rand_state), GMP_ABS (limiter) * GMP_LIMB_BITS);
#else
@@ -1814,6 +1833,91 @@ ZEND_FUNCTION(gmp_random)
}
/* }}} */
+/* {{{ proto GMP gmp_random_bits(int bits)
+ Gets a random number in the range 0 to (2 ** n) - 1 */
+ZEND_FUNCTION(gmp_random_bits)
+{
+ long bits;
+ mpz_ptr gmpnum_result;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &bits) == FAILURE) {
+ return;
+ }
+
+ if (bits <= 0) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The number of bits must be positive");
+ RETURN_FALSE;
+ }
+
+ INIT_GMP_RETVAL(gmpnum_result);
+ gmp_init_random(TSRMLS_C);
+
+ mpz_urandomb(gmpnum_result, GMPG(rand_state), bits);
+}
+/* }}} */
+
+/* {{{ proto GMP gmp_random_range(mixed min, mixed max)
+ Gets a random number in the range min to max */
+ZEND_FUNCTION(gmp_random_range)
+{
+ zval *min_arg, *max_arg;
+ mpz_ptr gmpnum_min, gmpnum_max, gmpnum_result;
+ gmp_temp_t temp_a, temp_b;
+
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &min_arg, &max_arg) == FAILURE) {
+ return;
+ }
+
+ gmp_init_random(TSRMLS_C);
+
+ FETCH_GMP_ZVAL(gmpnum_max, max_arg, temp_a);
+
+ if (Z_TYPE_P(min_arg) == IS_LONG && Z_LVAL_P(min_arg) >= 0) {
+ if (mpz_cmp_ui(gmpnum_max, Z_LVAL_P(min_arg)) <= 0) {
+ FREE_GMP_TEMP(temp_a);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The minimum value must be less than the maximum value");
+ RETURN_FALSE;
+ }
+
+ INIT_GMP_RETVAL(gmpnum_result);
+
+ if (Z_LVAL_P(min_arg)) {
+ mpz_sub_ui(gmpnum_max, gmpnum_max, Z_LVAL_P(min_arg));
+ }
+
+ mpz_add_ui(gmpnum_max, gmpnum_max, 1);
+ mpz_urandomm(gmpnum_result, GMPG(rand_state), gmpnum_max);
+
+ if (Z_LVAL_P(min_arg)) {
+ mpz_add_ui(gmpnum_result, gmpnum_result, Z_LVAL_P(min_arg));
+ }
+
+ FREE_GMP_TEMP(temp_a);
+
+ }
+ else {
+ FETCH_GMP_ZVAL_DEP(gmpnum_min, min_arg, temp_b, temp_a);
+
+ if (mpz_cmp(gmpnum_max, gmpnum_min) <= 0) {
+ FREE_GMP_TEMP(temp_b);
+ FREE_GMP_TEMP(temp_a);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The minimum value must be less than the maximum value");
+ RETURN_FALSE;
+ }
+
+ INIT_GMP_RETVAL(gmpnum_result);
+
+ mpz_sub(gmpnum_max, gmpnum_max, gmpnum_min);
+ mpz_add_ui(gmpnum_max, gmpnum_max, 1);
+ mpz_urandomm(gmpnum_result, GMPG(rand_state), gmpnum_max);
+ mpz_add(gmpnum_result, gmpnum_result, gmpnum_min);
+
+ FREE_GMP_TEMP(temp_b);
+ FREE_GMP_TEMP(temp_a);
+ }
+}
+/* }}} */
+
/* {{{ proto GMP gmp_and(mixed a, mixed b)
Calculates logical AND of a and b */
ZEND_FUNCTION(gmp_and)
diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h
index b3706c534d..a1a1dc262f 100644
--- a/ext/gmp/php_gmp.h
+++ b/ext/gmp/php_gmp.h
@@ -66,6 +66,8 @@ ZEND_FUNCTION(gmp_or);
ZEND_FUNCTION(gmp_com);
ZEND_FUNCTION(gmp_xor);
ZEND_FUNCTION(gmp_random);
+ZEND_FUNCTION(gmp_random_bits);
+ZEND_FUNCTION(gmp_random_range);
ZEND_FUNCTION(gmp_setbit);
ZEND_FUNCTION(gmp_clrbit);
ZEND_FUNCTION(gmp_scan0);
diff --git a/ext/gmp/tests/gmp_random_bits.phpt b/ext/gmp/tests/gmp_random_bits.phpt
new file mode 100644
index 0000000000..21d493cdb6
--- /dev/null
+++ b/ext/gmp/tests/gmp_random_bits.phpt
@@ -0,0 +1,45 @@
+--TEST--
+gmp_random_bits() basic tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(gmp_random_bits());
+var_dump(gmp_random_bits(0));
+var_dump(gmp_random_bits(-1));
+
+// If these error the test fails.
+gmp_random_bits(1);
+gmp_random_bits(1024);
+
+// 2 seconds to make sure the numbers stay in range
+$start = microtime(true);
+$limit = (2 ** 30) - 1;
+while (1) {
+ for ($i = 0; $i < 5000; $i++) {
+ $result = gmp_random_bits(30);
+ if ($result < 0 || $result > $limit) {
+ print "RANGE VIOLATION\n";
+ var_dump($result);
+ break 2;
+ }
+ }
+
+ if (microtime(true) - $start > 2) {
+ break;
+ }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: gmp_random_bits() expects exactly 1 parameter, 0 given in %s on line %d
+NULL
+
+Warning: gmp_random_bits(): The number of bits must be positive in %s on line %d
+bool(false)
+
+Warning: gmp_random_bits(): The number of bits must be positive in %s on line %d
+bool(false)
+Done
diff --git a/ext/gmp/tests/gmp_random_range.phpt b/ext/gmp/tests/gmp_random_range.phpt
new file mode 100644
index 0000000000..a8e7c4a9c1
--- /dev/null
+++ b/ext/gmp/tests/gmp_random_range.phpt
@@ -0,0 +1,81 @@
+--TEST--
+gmp_random_range() basic tests
+--SKIPIF--
+<?php if (!extension_loaded("gmp")) print "skip"; ?>
+--FILE--
+<?php
+
+$minusTen = gmp_init(-1);
+$plusTen = gmp_init(1);
+$zero = gmp_init(0);
+
+var_dump(gmp_random_range());
+var_dump(gmp_random_range(10));
+var_dump(gmp_random_range(10, -10));
+
+var_dump(gmp_random_range($plusTen, $minusTen));
+var_dump(gmp_random_range($plusTen, $zero));
+
+// If these error the test fails.
+gmp_random_range(0, 10);
+gmp_random_range(1, 10);
+gmp_random_range(-1, 10);
+gmp_random_range(-10, 0);
+gmp_random_range(-10, -1);
+
+gmp_random_range(0, $plusTen);
+gmp_random_range(1, $plusTen);
+gmp_random_range(-1, $plusTen);
+
+gmp_random_range($zero, $plusTen);
+gmp_random_range($minusTen, $plusTen);
+
+// 2 seconds to make sure the numbers stay in range
+$start = microtime(true);
+while (1) {
+ for ($i = 0; $i < 5000; $i++) {
+ $result = gmp_random_range(0, 1000);
+ if ($result < 0 || $result > 1000) {
+ print "RANGE VIOLATION 1\n";
+ var_dump($result);
+ break 2;
+ }
+
+ $result = gmp_random_range(-1000, 0);
+ if ($result < -1000 || $result > 0) {
+ print "RANGE VIOLATION 2\n";
+ var_dump($result);
+ break 2;
+ }
+
+ $result = gmp_random_range(-500, 500);
+ if ($result < -500 || $result > 500) {
+ print "RANGE VIOLATION 3\n";
+ var_dump($result);
+ break 2;
+ }
+ }
+
+ if (microtime(true) - $start > 2) {
+ break;
+ }
+}
+
+echo "Done\n";
+?>
+--EXPECTF--
+Warning: gmp_random_range() expects exactly 2 parameters, 0 given in %s on line %d
+NULL
+
+Warning: gmp_random_range() expects exactly 2 parameters, 1 given in %s on line %d
+NULL
+
+Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d
+bool(false)
+
+Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d
+bool(false)
+
+Warning: gmp_random_range(): The minimum value must be less than the maximum value in %s on line %d
+bool(false)
+Done
diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c
index 50055a25a7..8a141c0066 100644
--- a/ext/ldap/ldap.c
+++ b/ext/ldap/ldap.c
@@ -391,6 +391,23 @@ static int _get_lderrno(LDAP *ldap)
}
/* }}} */
+/* {{{ _set_lderrno
+ */
+static void _set_lderrno(LDAP *ldap, int lderr)
+{
+#if !HAVE_NSLDAP
+#if LDAP_API_VERSION > 2000 || HAVE_ORALDAP
+ /* New versions of OpenLDAP do it this way */
+ ldap_set_option(ldap, LDAP_OPT_ERROR_NUMBER, &lderr);
+#else
+ ldap->ld_errno = lderr;
+#endif
+#else
+ ldap_set_lderrno(ldap, lderr, NULL, NULL);
+#endif
+}
+/* }}} */
+
/* {{{ proto bool ldap_bind(resource link [, string dn [, string password]])
Bind to LDAP directory */
PHP_FUNCTION(ldap_bind)
@@ -405,18 +422,20 @@ PHP_FUNCTION(ldap_bind)
RETURN_FALSE;
}
+ ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
+
if (ldap_bind_dn != NULL && memchr(ldap_bind_dn, '\0', ldap_bind_dnlen) != NULL) {
+ _set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "DN contains a null byte");
RETURN_FALSE;
}
if (ldap_bind_pw != NULL && memchr(ldap_bind_pw, '\0', ldap_bind_pwlen) != NULL) {
+ _set_lderrno(ld->link, LDAP_INVALID_CREDENTIALS);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Password contains a null byte");
RETURN_FALSE;
}
- ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, &link, -1, "ldap link", le_link);
-
if ((rc = ldap_bind_s(ld->link, ldap_bind_dn, ldap_bind_pw, LDAP_AUTH_SIMPLE)) != LDAP_SUCCESS) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to bind to server: %s", ldap_err2string(rc));
RETURN_FALSE;
diff --git a/ext/mysqlnd/config9.m4 b/ext/mysqlnd/config9.m4
index 78e1bf1df0..8f749cf273 100644
--- a/ext/mysqlnd/config9.m4
+++ b/ext/mysqlnd/config9.m4
@@ -58,12 +58,17 @@ dnl
AC_CACHE_CHECK([whether whether compiler supports Decimal32/64/128 types], ac_cv_decimal_fp_supported,[
AC_TRY_RUN( [
#include <stdio.h>
+#include <string.h>
int main(int argc, char **argv) {
typedef float dec32 __attribute__((mode(SD)));
dec32 k = 99.49f;
double d2 = (double)k;
- return 0;
+ const char *check_str = "99.49";
+ char print_str[32];
+
+ snprintf(print_str, 32, "%f", d2);
+ return memcmp(print_str, check_str, 5);
}
],[
ac_cv_decimal_fp_supported=yes
diff --git a/ext/mysqlnd/mysqlnd_ps_codec.c b/ext/mysqlnd/mysqlnd_ps_codec.c
index 3ff0019c00..3af19cbc95 100644
--- a/ext/mysqlnd/mysqlnd_ps_codec.c
+++ b/ext/mysqlnd/mysqlnd_ps_codec.c
@@ -200,17 +200,27 @@ ps_fetch_float(zval * zv, const MYSQLND_FIELD * const field, unsigned int pack_l
/* The following cast is guaranteed to do the right thing */
dval = (double) d32val;
}
+#elif defined(PHP_WIN32)
+ {
+ /* float datatype on Winows is already 4 byte but has a precision of 7 digits */
+ char num_buf[2048];
+ (void)_gcvt_s(num_buf, 2048, fval, field->decimals >= 31 ? 7 : field->decimals);
+ dval = zend_strtod(num_buf, NULL);
+ }
#else
{
char num_buf[2048]; /* Over allocated */
char *s;
+#ifndef FLT_DIG
+# define FLT_DIG 6
+#endif
/* Convert to string. Ignoring localization, etc.
* Following MySQL's rules. If precision is undefined (NOT_FIXED_DEC i.e. 31)
* or larger than 31, the value is limited to 6 (FLT_DIG).
*/
s = php_gcvt(fval,
- field->decimals >= 31 ? 6 : field->decimals,
+ field->decimals >= 31 ? FLT_DIG : field->decimals,
'.',
'e',
num_buf);
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 19f9fe4eb0..b9bee9676a 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -951,14 +951,15 @@ int odbc_bindcols(odbc_result *result TSRMLS_DC)
SQLUSMALLINT colfieldid;
int charextraalloc;
- colfieldid = SQL_COLUMN_DISPLAY_SIZE;
- charextraalloc = 0;
result->values = (odbc_result_value *) safe_emalloc(sizeof(odbc_result_value), result->numcols, 0);
result->longreadlen = ODBCG(defaultlrl);
result->binmode = ODBCG(defaultbinmode);
for(i = 0; i < result->numcols; i++) {
+ charextraalloc = 0;
+ colfieldid = SQL_COLUMN_DISPLAY_SIZE;
+
rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_NAME,
result->values[i].name, sizeof(result->values[i].name), &colnamelen, 0);
rc = SQLColAttributes(result->stmt, (SQLUSMALLINT)(i+1), SQL_COLUMN_TYPE,
diff --git a/ext/odbc/tests/bug68087.phpt b/ext/odbc/tests/bug68087.phpt
new file mode 100644
index 0000000000..3bc18125a6
--- /dev/null
+++ b/ext/odbc/tests/bug68087.phpt
@@ -0,0 +1,57 @@
+--TEST--
+odbc_exec(): Getting accurate date data from query
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+
+include 'config.inc';
+
+$id_1_date = '2014-09-23';
+$id_2_date = '2014-09-24';
+
+$conn = odbc_connect($dsn, $user, $pass);
+
+@odbc_exec($conn, 'CREATE DATABASE odbcTEST');
+
+odbc_exec($conn, 'CREATE TABLE FOO (ID INT, VARCHAR_COL VARCHAR(100), DATE_COL DATE)');
+
+odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL, DATE_COL) VALUES (1, 'hello', '$id_1_date')");
+odbc_exec($conn, "INSERT INTO FOO(ID, VARCHAR_COL, DATE_COL) VALUES (2, 'helloagain', '$id_2_date')");
+
+$res = odbc_exec($conn, 'SELECT * FROM FOO ORDER BY ID ASC');
+
+while(odbc_fetch_row($res)) {
+ $id = odbc_result($res, "ID");
+ $varchar_col = odbc_result($res, "VARCHAR_COL");
+ $date = odbc_result($res, "DATE_COL");
+
+ if ($id == 1) {
+ if ($date != $id_1_date) {
+ print "Date_1 mismatched\n";
+ } else {
+ print "Date_1 matched\n";
+ }
+ } else {
+ if ($date != $id_2_date) {
+ print "Date_2 mismatched\n";
+ } else {
+ print "Date_2 matched\n";
+ }
+ }
+}
+
+?>
+--EXPECT--
+Date_1 matched
+Date_2 matched
+--CLEAN--
+<?php
+include 'config.inc';
+
+$conn = odbc_connect($dsn, $user, $pass);
+
+odbc_exec($conn, 'DROP TABLE FOO');
+odbc_exec($conn, 'DROP DATABASE odbcTEST');
+
+?>
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index 30705ff18a..41dde05083 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -252,6 +252,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
break;
}
}
+ if (Z_TYPE(c) == IS_CONSTANT_AST) {
+ break;
+ }
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
replace_tmp_by_const(op_array, opline, tv, &c TSRMLS_CC);
@@ -303,6 +306,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
Z_STRVAL(ZEND_OP2_LITERAL(opline)),
Z_STRLEN(ZEND_OP2_LITERAL(opline)) + 1,
(void **) &c) == SUCCESS) {
+ if (Z_TYPE_PP(c) == IS_CONSTANT_AST) {
+ break;
+ }
if (ZEND_IS_CONSTANT_TYPE(Z_TYPE_PP(c))) {
if (!zend_get_persistent_constant(Z_STRVAL_PP(c), Z_STRLEN_PP(c), &t, 1 TSRMLS_CC) ||
ZEND_IS_CONSTANT_TYPE(Z_TYPE(t))) {
diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4
index a97114f808..701e488385 100644
--- a/ext/openssl/config0.m4
+++ b/ext/openssl/config0.m4
@@ -8,6 +8,9 @@ PHP_ARG_WITH(openssl, for OpenSSL support,
PHP_ARG_WITH(kerberos, for Kerberos support,
[ --with-kerberos[=DIR] OPENSSL: Include Kerberos support], no, no)
+PHP_ARG_WITH(system-ciphers, whether to use system default cipher list instead of hardcoded value,
+[ --with-system-ciphers OPENSSL: Use system default cipher list instead of hardcoded value], no, no)
+
if test "$PHP_OPENSSL" != "no"; then
PHP_NEW_EXTENSION(openssl, openssl.c xp_ssl.c, $ext_shared)
PHP_SUBST(OPENSSL_SHARED_LIBADD)
@@ -25,4 +28,7 @@ if test "$PHP_OPENSSL" != "no"; then
], [
AC_MSG_ERROR([OpenSSL check failed. Please check config.log for more information.])
])
+ if test "$PHP_SYSTEM_CIPHERS" != "no"; then
+ AC_DEFINE(USE_OPENSSL_SYSTEM_CIPHERS,1,[ Use system default cipher list instead of hardcoded value ])
+ fi
fi
diff --git a/ext/openssl/tests/bug65729.pem b/ext/openssl/tests/bug65729.pem
index dbeed6efd3..918445712e 100644
--- a/ext/openssl/tests/bug65729.pem
+++ b/ext/openssl/tests/bug65729.pem
@@ -1,28 +1,32 @@
------BEGIN CERTIFICATE-----
-MIICCTCCAXICCQDNMI29sowT7TANBgkqhkiG9w0BAQUFADBJMQswCQYDVQQGEwJT
-RzESMBAGA1UECBMJVGVzdHZpbGxlMREwDwYDVQQKEwhkYXRpYmJhdzETMBEGA1UE
-AxQKKi50ZXN0LmNvbTAeFw0xMzA5MjEwNzUyMjRaFw0xNDA5MjEwNzUyMjRaMEkx
-CzAJBgNVBAYTAlNHMRIwEAYDVQQIEwlUZXN0dmlsbGUxETAPBgNVBAoTCGRhdGli
-YmF3MRMwEQYDVQQDFAoqLnRlc3QuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
-iQKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK03oAd1jTe
-Vd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOXZPG3UViD
-rtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQABMA0GCSqG
-SIb3DQEBBQUAA4GBAAS07u/Ke+EhEHidz6CG3Qcr+zg483JKRgZFyGz+YUKyyKKy
-fmLs7JieGJxYQjOmIpj/6X9Gnb2HjIPDnI6A+MV1emXDTnnmsgf2/lZGcthhpZn2
-rMbj9bI0iH6HwOVGtp4ZJA5fB7nj3J+gWNTCQzDDOxwX36d2LL9ua+UMnk/g
------END CERTIFICATE-----
-----BEGIN RSA PRIVATE KEY-----
-MIICXQIBAAKBgQCdzVnic8K5W4SVbwVuqezcTjeqVLoQ91vVNZB0Jnsuz6q3DoK0
-3oAd1jTeVd0k+MQDbXpHoc37lA4+8z/g5Bs0UXxNx+nkbFTE7Ba2/G24caI9/cOX
-ZPG3UViDrtqXKL6h5/umqRG9Dt5liF2MVP9XFAesVC7B8+Ca+PbPlQoYzwIDAQAB
-AoGAeyzTwKPDl5QMRejHQL57GOwlH1vLcXrjv+VzwHZZKQ0IoKM++5fCQYf29KXp
-XPahaluGW2u9sWa8R/7wGcd0Q4RtquGzsgT3+AQsIc5KfIamyOyDaRVM/ymX3fWg
-gHIU7OOzB+ihOU8sHyRIwfbk01/kmrBXLRj8E31sy3i3PIECQQDQQYE+aN7Acrdt
-yN5CaqvbkiCGjRvASlemiTzPosgOtndyp21w1gakJwKYhYDk1N6A6Qb8REMZqM/U
-wFypldV/AkEAwfq6NFuhpGL6hDA7MvlyY1KiZ0cHetPUX+PgdNqy2DA+1Sv4i7gm
-Wd/uA651K7aPXuUaf9dKtPCmZwI4M6SEsQJBALW89HTqP7niYoDEEnITdPaghxHk
-gptERUln6lGo1L1CLus3gSI/JHyMLo+7scgAnEwTD62GRKhX0Ubwt+ymfTECQAY5
-fHYnppU20+EgBxZIqOIFCc8UmWnYmE0Ha/Fz/x8u1SVUBuK84wYpSGL32yyu7ATY
-hzQo/W229zABAzqtAdECQQCUdB7IBFpPnsfv/EUBFX7X/7zAc9JpACmu9It5ju8C
-KIsMuz/02D+TQoJNjdAngBM+4AJDIaGFgTMIfaDMh5L7
+MIICXgIBAAKBgQDU8RgB8O2uR3ApjlxEX5rpCI+gIaZ3h0RBAF9rNA/s0pPTtX/e
+NGJgDyuT/TF6mcv0I/0/s2WSmIE50NW6tgWZ7RoBdVw/MiByPt6vK1aDrggbycN/
+C6RrxrEsdZe3E9CDZCFM1br8/8tnV19Ju80g8zY2MgDjAjSkeXN5yp3kgQIDAQAB
+AoGBANFKKRt3TlRVmHLvndYB1YKmzGtJx5CBXV85247FO8W67lpNcGDYQbxCDMXG
+PARQ9vl9CeK7EuDzjUdi7z40uujUOJtsLbMP6ikwKFi/tA2cW1yoLionZ3JkfyEr
+4Uu8kkkIut0VLX8uuVz/Y03lt8Uzc+GvD2DPhkSQn80f10SFAkEA94EcjwFcwuVi
+QofgOPbf7qfOoWDsXYhlMU9g1CaPJiMcMcvgoLK3V514oMDxlkvuLujlYeG9NvRS
+tREluGsbywJBANxARX5MSzAkFRNZNZKDUvifdC0BA2Dqzd2iOJRcTdcebGENd7+e
+oub/9lVLGrX7T4U2en8IXwJV4UHxwoQLz2MCQQCI1Bj8ui0VFgj/bOy5sUnVP3IN
+Z27kuo3u98o5HuQOmmRw5xxU2thfGJBilqg4hdu0lU6SkWCwq9u5fDRVQumHAkAM
+mJBg3LQgGLAr3xo1OtVv6o6WVEyBKmyDlFdwBKde+hpwoniKuOPQGitYTWdFqQ2v
+LKJsyWnFlGvBfbYGHzbJAkEA17SgCf7Wx7NxuLCSMj/rd25ul0jlIrjx6+/HfyLb
++T2SXXU4g2DBiPngrfJ9jX8QGoLpZiBGcwX3QxssX5FgJQ==
-----END RSA PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIICvDCCAiWgAwIBAgIJANOyJnvPEioVMA0GCSqGSIb3DQEBBQUAMEkxCzAJBgNV
+BAYTAlNHMRIwEAYDVQQIEwlUZXN0dmlsbGUxETAPBgNVBAoTCGRhdGliYmF3MRMw
+EQYDVQQDFAoqLnRlc3QuY29tMB4XDTE0MTAxNTEzMDg1OFoXDTM0MTAxMDEzMDg1
+OFowSTELMAkGA1UEBhMCU0cxEjAQBgNVBAgTCVRlc3R2aWxsZTERMA8GA1UEChMI
+ZGF0aWJiYXcxEzARBgNVBAMUCioudGVzdC5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD
+gY0AMIGJAoGBANTxGAHw7a5HcCmOXERfmukIj6AhpneHREEAX2s0D+zSk9O1f940
+YmAPK5P9MXqZy/Qj/T+zZZKYgTnQ1bq2BZntGgF1XD8yIHI+3q8rVoOuCBvJw38L
+pGvGsSx1l7cT0INkIUzVuvz/y2dXX0m7zSDzNjYyAOMCNKR5c3nKneSBAgMBAAGj
+gaswgagwHQYDVR0OBBYEFErHO0eHLp9YvBWVvvhty/jGie5wMHkGA1UdIwRyMHCA
+FErHO0eHLp9YvBWVvvhty/jGie5woU2kSzBJMQswCQYDVQQGEwJTRzESMBAGA1UE
+CBMJVGVzdHZpbGxlMREwDwYDVQQKEwhkYXRpYmJhdzETMBEGA1UEAxQKKi50ZXN0
+LmNvbYIJANOyJnvPEioVMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEA
+gMv2HUUp0FMTYQ6tL9YgNUNARukxJzGDWweo4/YuNSgI+Ljpye4Nf1MpyDWfhZGc
+QbUhfm5CdEvcBzZBtI0lLXs61yGdLnDH/6QHViXP2rlH0yeAABw8+wSdxuiZN1yR
+ed4pNXU+tczgW2Ri2+T0ScOZd0XommKHrQnu2T9mMBY=
+-----END CERTIFICATE-----
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 1af8b12115..debd1f16d2 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -1476,13 +1476,16 @@ int php_openssl_setup_crypto(php_stream *stream,
}
GET_VER_OPT_STRING("ciphers", cipherlist);
+#ifndef USE_OPENSSL_SYSTEM_CIPHERS
if (!cipherlist) {
cipherlist = OPENSSL_DEFAULT_STREAM_CIPHERS;
}
- if (SSL_CTX_set_cipher_list(sslsock->ctx, cipherlist) != 1) {
- return FAILURE;
+#endif
+ if (cipherlist) {
+ if (SSL_CTX_set_cipher_list(sslsock->ctx, cipherlist) != 1) {
+ return FAILURE;
+ }
}
-
if (FAILURE == set_local_cert(sslsock->ctx, stream TSRMLS_CC)) {
return FAILURE;
}
@@ -1804,59 +1807,13 @@ static size_t php_openssl_sockop_write(php_stream *stream, const char *buf, size
}
/* }}} */
-static void php_openssl_stream_wait_for_data(php_netstream_data_t *sock)
-{
- int retval;
- struct timeval *ptimeout;
-
- if (sock->socket == -1) {
- return;
- }
-
- sock->timeout_event = 0;
-
- if (sock->timeout.tv_sec == -1)
- ptimeout = NULL;
- else
- ptimeout = &sock->timeout;
-
- while(1) {
- retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout);
-
- if (retval == 0)
- sock->timeout_event = 1;
-
- if (retval >= 0)
- break;
-
- if (php_socket_errno() != EINTR)
- break;
- }
-}
-
static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) /* {{{ */
{
php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream->abstract;
- php_netstream_data_t *sock;
int nr_bytes = 0;
if (sslsock->ssl_active) {
int retry = 1;
- sock = (php_netstream_data_t*)stream->abstract;
-
- /* The SSL_read() function will block indefinitely waiting for data on a blocking
- socket. If we don't poll for readability first this operation has the potential
- to hang forever. To avoid this scenario we poll with a timeout before performing
- the actual read. If it times out we're finished.
- */
- if (sock->is_blocked) {
- php_openssl_stream_wait_for_data(sock);
- if (sock->timeout_event) {
- stream->eof = 1;
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSL read operation timed out");
- return nr_bytes;
- }
- }
do {
nr_bytes = SSL_read(sslsock->ssl_handle, buf, count);
@@ -2176,19 +2133,6 @@ static int php_openssl_sockop_cast(php_stream *stream, int castas, void **ret TS
case PHP_STREAM_AS_FD_FOR_SELECT:
if (ret) {
- if (sslsock->ssl_active) {
- /* OpenSSL has an internal buffer which select() cannot see. If we don't
- fetch it into the stream's buffer, no activity will be reported on the
- stream even though there is data waiting to be read - but we only fetch
- the number of bytes OpenSSL has ready to give us since we weren't asked
- for any data at this stage. This is only likely to cause issues with
- non-blocking streams, but it's harmless to always do it. */
- int bytes;
- while ((bytes = SSL_pending(sslsock->ssl_handle)) > 0) {
- php_stream_fill_read_buffer(stream, (size_t)bytes);
- }
- }
-
*(php_socket_t *)ret = sslsock->s.socket;
}
return SUCCESS;
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 8e5fcadef4..b2a3005868 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -1015,9 +1015,12 @@ static int _extension_class_string(zend_class_entry **pce TSRMLS_DC, int num_arg
int *num_classes = va_arg(args, int*);
if (((*pce)->type == ZEND_INTERNAL_CLASS) && (*pce)->info.internal.module && !strcasecmp((*pce)->info.internal.module->name, module->name)) {
- string_printf(str, "\n");
- _class_string(str, *pce, NULL, indent TSRMLS_CC);
- (*num_classes)++;
+ /* dump class if it is not an alias */
+ if (!zend_binary_strcasecmp((*pce)->name, (*pce)->name_length, hash_key->arKey, hash_key->nKeyLength-1)) {
+ string_printf(str, "\n");
+ _class_string(str, *pce, NULL, indent TSRMLS_CC);
+ (*num_classes)++;
+ }
}
return ZEND_HASH_APPLY_KEEP;
}
@@ -5395,12 +5398,24 @@ static int add_extension_class(zend_class_entry **pce TSRMLS_DC, int num_args, v
int add_reflection_class = va_arg(args, int);
if (((*pce)->type == ZEND_INTERNAL_CLASS) && (*pce)->info.internal.module && !strcasecmp((*pce)->info.internal.module->name, module->name)) {
+ const char *name;
+ int nlen;
+
+ if (zend_binary_strcasecmp((*pce)->name, (*pce)->name_length, hash_key->arKey, hash_key->nKeyLength-1)) {
+ /* This is an class alias, use alias name */
+ name = hash_key->arKey;
+ nlen = hash_key->nKeyLength-1;
+ } else {
+ /* Use class name */
+ name = (*pce)->name;
+ nlen = (*pce)->name_length;
+ }
if (add_reflection_class) {
ALLOC_ZVAL(zclass);
zend_reflection_class_factory(*pce, zclass TSRMLS_CC);
- add_assoc_zval_ex(class_array, (*pce)->name, (*pce)->name_length + 1, zclass);
+ add_assoc_zval_ex(class_array, name, nlen+1, zclass);
} else {
- add_next_index_stringl(class_array, (*pce)->name, (*pce)->name_length, 1);
+ add_next_index_stringl(class_array, name, nlen, 1);
}
}
return ZEND_HASH_APPLY_KEEP;
@@ -6083,7 +6098,7 @@ ZEND_END_ARG_INFO()
static const zend_function_entry reflection_zend_extension_functions[] = {
ZEND_ME(reflection, __clone, arginfo_reflection__void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
ZEND_ME(reflection_zend_extension, export, arginfo_reflection_extension_export, ZEND_ACC_STATIC|ZEND_ACC_PUBLIC)
- ZEND_ME(reflection_zend_extension, __construct, arginfo_reflection_extension___construct, 0)
+ ZEND_ME(reflection_zend_extension, __construct, arginfo_reflection_zend_extension___construct, 0)
ZEND_ME(reflection_zend_extension, __toString, arginfo_reflection__void, 0)
ZEND_ME(reflection_zend_extension, getName, arginfo_reflection__void, 0)
ZEND_ME(reflection_zend_extension, getVersion, arginfo_reflection__void, 0)
diff --git a/ext/session/mod_user_class.c b/ext/session/mod_user_class.c
index 5b1480bf8c..2cbe482349 100644
--- a/ext/session/mod_user_class.c
+++ b/ext/session/mod_user_class.c
@@ -148,6 +148,8 @@ PHP_METHOD(SessionHandler, create_sid)
{
char *id;
+ PS_SANITY_CHECK;
+
if (zend_parse_parameters_none() == FAILURE) {
return;
}
diff --git a/ext/session/tests/bug67972.phpt b/ext/session/tests/bug67972.phpt
new file mode 100644
index 0000000000..63ed3a95b8
--- /dev/null
+++ b/ext/session/tests/bug67972.phpt
@@ -0,0 +1,10 @@
+--TEST--
+Bug #67972: SessionHandler Invalid memory read create_sid()
+--SKIPIF--
+<?php include('skipif.inc'); ?>
+--FILE--
+<?php
+
+(new SessionHandler)->create_sid();
+--EXPECTF--
+Fatal error: SessionHandler::create_sid(): Cannot call default session handler in %s on line %d
diff --git a/ext/spl/spl_engine.h b/ext/spl/spl_engine.h
index a67e60c105..473438bb7a 100644
--- a/ext/spl/spl_engine.h
+++ b/ext/spl/spl_engine.h
@@ -49,6 +49,41 @@ static inline int spl_instantiate_arg_ex2(zend_class_entry *pce, zval **retval,
}
/* }}} */
+/* {{{ spl_instantiate_arg_n */
+static inline void spl_instantiate_arg_n(zend_class_entry *pce, zval **retval, int argc, zval ***argv TSRMLS_DC)
+{
+ zend_function *func = pce->constructor;
+ zend_fcall_info fci;
+ zend_fcall_info_cache fcc;
+ zval *dummy;
+ zval z_name;
+
+ spl_instantiate(pce, retval, 0 TSRMLS_CC);
+
+ ZVAL_STRING(&z_name, func->common.function_name, 0);
+
+ fci.size = sizeof(zend_fcall_info);
+ fci.function_table = &pce->function_table;
+ fci.function_name = &z_name;
+ fci.object_ptr = *retval;
+ fci.symbol_table = NULL;
+ fci.retval_ptr_ptr = &dummy;
+ fci.param_count = argc;
+ fci.params = argv;
+ fci.no_separation = 1;
+
+ fcc.initialized = 1;
+ fcc.function_handler = func;
+ fcc.calling_scope = EG(scope);
+ fcc.called_scope = pce;
+ fcc.object_ptr = *retval;
+
+ zend_call_function(&fci, &fcc TSRMLS_CC);
+
+ zval_ptr_dtor(&dummy);
+}
+/* }}} */
+
#endif /* SPL_ENGINE_H */
/*
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index f51d6c2468..3a37241bf5 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -2045,8 +2045,10 @@ SPL_METHOD(RegexIterator, accept)
if (intern->current.data == NULL) {
RETURN_FALSE;
+ } else if (Z_TYPE_P(intern->current.data) == IS_ARRAY) {
+ RETURN_FALSE;
}
-
+
if (intern->u.regex.flags & REGIT_USE_KEY) {
subject_ptr = intern->current.key;
} else {
@@ -2080,8 +2082,7 @@ SPL_METHOD(RegexIterator, accept)
ALLOC_INIT_ZVAL(intern->current.data);
php_pcre_match_impl(intern->u.regex.pce, subject, subject_len, &zcount,
intern->current.data, intern->u.regex.mode == REGIT_MODE_ALL_MATCHES, intern->u.regex.use_flags, intern->u.regex.preg_flags, 0 TSRMLS_CC);
- count = zend_hash_num_elements(Z_ARRVAL_P(intern->current.data));
- RETVAL_BOOL(count > 0);
+ RETVAL_BOOL(Z_LVAL(zcount) > 0);
break;
case REGIT_MODE_SPLIT:
@@ -2259,7 +2260,7 @@ SPL_METHOD(RecursiveRegexIterator, __construct)
SPL_METHOD(RecursiveRegexIterator, getChildren)
{
spl_dual_it_object *intern;
- zval *retval, *regex;
+ zval *retval;
if (zend_parse_parameters_none() == FAILURE) {
return;
@@ -2269,16 +2270,61 @@ SPL_METHOD(RecursiveRegexIterator, getChildren)
zend_call_method_with_0_params(&intern->inner.zobject, intern->inner.ce, NULL, "getchildren", &retval);
if (!EG(exception)) {
+ zval **args[5], *object, *regex, *mode, *flags, *preg_flags;
+
+ MAKE_STD_ZVAL(object);
MAKE_STD_ZVAL(regex);
+ MAKE_STD_ZVAL(mode);
+ MAKE_STD_ZVAL(flags);
+ MAKE_STD_ZVAL(preg_flags);
+
+ MAKE_COPY_ZVAL(&retval, object);
ZVAL_STRING(regex, intern->u.regex.regex, 1);
- spl_instantiate_arg_ex2(Z_OBJCE_P(getThis()), &return_value, 0, retval, regex TSRMLS_CC);
+ ZVAL_LONG(mode, intern->u.regex.mode);
+ ZVAL_LONG(flags, intern->u.regex.flags);
+ ZVAL_LONG(preg_flags, intern->u.regex.preg_flags);
+
+ args[0] = &object;
+ args[1] = &regex;
+ args[2] = &mode;
+ args[3] = &flags;
+ args[4] = &preg_flags;
+
+ spl_instantiate_arg_n(Z_OBJCE_P(getThis()), &return_value, 5, args TSRMLS_CC);
+
+ zval_ptr_dtor(&object);
zval_ptr_dtor(&regex);
+ zval_ptr_dtor(&mode);
+ zval_ptr_dtor(&flags);
+ zval_ptr_dtor(&preg_flags);
}
if (retval) {
zval_ptr_dtor(&retval);
}
} /* }}} */
+SPL_METHOD(RecursiveRegexIterator, accept)
+{
+ spl_dual_it_object *intern;
+ zval *rv;
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ return;
+ }
+
+ SPL_FETCH_AND_CHECK_DUAL_IT(intern, getThis());
+
+ if (intern->current.data == NULL) {
+ RETURN_FALSE;
+ } else if (Z_TYPE_P(intern->current.data) == IS_ARRAY) {
+ RETURN_BOOL(zend_hash_num_elements(Z_ARRVAL_P(intern->current.data)) > 0);
+ }
+
+ zend_call_method_with_0_params(&(getThis()), spl_ce_RegexIterator, NULL, "accept", &rv);
+
+ RETURN_ZVAL(rv, 1, 1);
+}
+
#endif
/* {{{ spl_dual_it_dtor */
@@ -2469,6 +2515,7 @@ ZEND_END_ARG_INFO();
static const zend_function_entry spl_funcs_RecursiveRegexIterator[] = {
SPL_ME(RecursiveRegexIterator, __construct, arginfo_rec_regex_it___construct, ZEND_ACC_PUBLIC)
+ SPL_ME(RecursiveRegexIterator, accept, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
SPL_ME(RecursiveFilterIterator, hasChildren, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
SPL_ME(RecursiveRegexIterator, getChildren, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
PHP_FE_END
diff --git a/ext/spl/tests/bug68128.phpt b/ext/spl/tests/bug68128.phpt
new file mode 100644
index 0000000000..ff41dd4931
--- /dev/null
+++ b/ext/spl/tests/bug68128.phpt
@@ -0,0 +1,91 @@
+--TEST--
+Bug #68128 - RecursiveRegexIterator raises "Array to string conversion" notice
+--FILE--
+<?php
+
+$array = new ArrayIterator(array('a', array('b', 'c')));
+$regex = new RegexIterator($array, '/Array/');
+
+foreach ($regex as $match) {
+ var_dump($match);
+}
+
+$rArrayIterator = new RecursiveArrayIterator(array('test1', array('tet3', 'test4', 'test5')));
+$rRegexIterator = new RecursiveRegexIterator($rArrayIterator, '/^(t)est(\d*)/',
+ RecursiveRegexIterator::ALL_MATCHES, 0, PREG_PATTERN_ORDER);
+
+foreach ($rRegexIterator as $key1 => $value1) {
+
+ if ($rRegexIterator->hasChildren()) {
+
+ // print all children
+ echo "Children: ";
+ foreach ($rRegexIterator->getChildren() as $key => $value) {
+ print_r($value);
+ }
+ echo "\n";
+ } else {
+ echo "No children ";
+ print_r($value1);
+ echo "\n";
+ }
+}
+
+?>
+--EXPECT--
+No children Array
+(
+ [0] => Array
+ (
+ [0] => test1
+ )
+
+ [1] => Array
+ (
+ [0] => t
+ )
+
+ [2] => Array
+ (
+ [0] => 1
+ )
+
+)
+
+Children: Array
+(
+ [0] => Array
+ (
+ [0] => test4
+ )
+
+ [1] => Array
+ (
+ [0] => t
+ )
+
+ [2] => Array
+ (
+ [0] => 4
+ )
+
+)
+Array
+(
+ [0] => Array
+ (
+ [0] => test5
+ )
+
+ [1] => Array
+ (
+ [0] => t
+ )
+
+ [2] => Array
+ (
+ [0] => 5
+ )
+
+)
+
diff --git a/ext/spl/tests/iterator_048.phpt b/ext/spl/tests/iterator_048.phpt
index bad4e7888a..64ca97f4d6 100644
--- a/ext/spl/tests/iterator_048.phpt
+++ b/ext/spl/tests/iterator_048.phpt
@@ -13,11 +13,6 @@ class MyRecursiveRegexIterator extends RecursiveRegexIterator
var_dump($v);
}
}
-
- function accept()
- {
- return $this->hasChildren() || parent::accept();
- }
}
$ar = new RecursiveArrayIterator(array('Foo', array('Bar'), 'FooBar', array('Baz'), 'Biz'));
diff --git a/ext/spl/tests/iterator_050.phpt b/ext/spl/tests/iterator_050.phpt
index fed4a3b2ee..63d8fbfa9a 100644
--- a/ext/spl/tests/iterator_050.phpt
+++ b/ext/spl/tests/iterator_050.phpt
@@ -46,8 +46,6 @@ array(3) {
[2]=>
%s(1) "2"
}
-
-Notice: Array to string conversion in %siterator_050.php on line %d
int(0)
array(2) {
[0]=>
@@ -69,8 +67,6 @@ array(2) {
[1]=>
%s(1) "1"
}
-
-Notice: Array to string conversion in %siterator_050.php on line %d
object(ArrayIterator)#%d (1) {
%s"storage"%s"ArrayIterator":private]=>
array(9) {
diff --git a/ext/spl/tests/iterator_052.phpt b/ext/spl/tests/iterator_052.phpt
index c68bd5234d..84b3eb993c 100644
--- a/ext/spl/tests/iterator_052.phpt
+++ b/ext/spl/tests/iterator_052.phpt
@@ -46,18 +46,6 @@ var_dump($ar);
<?php exit(0); ?>
--EXPECTF--
bool(true)
-int(0)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
int(1)
array(3) {
@@ -97,85 +85,11 @@ array(3) {
}
}
bool(true)
-int(3)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
-int(4)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
-
-Notice: Array to string conversion in %siterator_052.php on line %d
+bool(false)
bool(true)
-int(5)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
-int(6)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
-int(7)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
-bool(true)
-int(8)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
int(0)
array(2) {
@@ -231,67 +145,11 @@ array(2) {
}
}
bool(true)
-int(3)
-array(2) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
-}
-bool(true)
-int(4)
-array(2) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
-}
-
-Notice: Array to string conversion in %siterator_052.php on line %d
bool(true)
-int(5)
-array(2) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
-}
+bool(false)
bool(true)
-int(6)
-array(2) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
-}
bool(true)
-int(7)
-array(2) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
-}
bool(true)
-int(8)
-array(2) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
-}
object(ArrayIterator)#%d (1) {
["storage":"ArrayIterator":private]=>
array(9) {
diff --git a/ext/spl/tests/iterator_053.phpt b/ext/spl/tests/iterator_053.phpt
index 5d9c740c31..b472523ab6 100644
--- a/ext/spl/tests/iterator_053.phpt
+++ b/ext/spl/tests/iterator_053.phpt
@@ -46,122 +46,14 @@ var_dump($ar);
<?php exit(0); ?>
--EXPECTF--
bool(true)
-int(0)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
-int(1)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
-int(2)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
-bool(true)
-int(3)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
-int(4)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
-int(5)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
+bool(false)
bool(true)
-int(6)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
-int(7)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
-int(8)
-array(3) {
- [0]=>
- array(0) {
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(0) {
- }
-}
bool(true)
int(0)
array(2) {
@@ -232,20 +124,7 @@ array(2) {
string(1) "4"
}
}
-bool(true)
-int(5)
-array(2) {
- [0]=>
- array(1) {
- [0]=>
- string(1) "5"
- }
- [1]=>
- array(1) {
- [0]=>
- string(1) "5"
- }
-}
+bool(false)
bool(true)
int(6)
array(2) {
diff --git a/ext/spl/tests/iterator_054.phpt b/ext/spl/tests/iterator_054.phpt
index 1f1cd580c1..91266c9571 100644
--- a/ext/spl/tests/iterator_054.phpt
+++ b/ext/spl/tests/iterator_054.phpt
@@ -42,8 +42,6 @@ array(3) {
[2]=>
string(1) "3"
}
-
-Notice: Array to string conversion in %siterator_054.php on line %d
int(7)
array(2) {
[0]=>
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 02246c6268..f1910d2191 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -365,8 +365,8 @@ static unsigned short php_read2(php_stream * stream TSRMLS_DC)
{
unsigned char a[2];
- /* just return 0 if we hit the end-of-file */
- if((php_stream_read(stream, a, sizeof(a))) <= 0) return 0;
+ /* return 0 if we couldn't read enough data */
+ if((php_stream_read(stream, a, sizeof(a))) < sizeof(a)) return 0;
return (((unsigned short)a[0]) << 8) + ((unsigned short)a[1]);
}
@@ -646,7 +646,7 @@ static struct gfxinfo *php_handle_jpc(php_stream * stream TSRMLS_DC)
#endif
result->channels = php_read2(stream TSRMLS_CC); /* Csiz */
- if (result->channels < 0 || result->channels > 256) {
+ if (result->channels == 0 && php_stream_eof(stream) || result->channels > 256) {
efree(result);
return NULL;
}
diff --git a/ext/standard/pack.c b/ext/standard/pack.c
index 16a30668dc..9427db90a0 100644
--- a/ext/standard/pack.c
+++ b/ext/standard/pack.c
@@ -82,6 +82,13 @@ static int machine_endian_long_map[4];
static int big_endian_long_map[4];
static int little_endian_long_map[4];
+#if SIZEOF_LONG > 4
+/* Mappings of bytes from quads (64bit) for all endian environments */
+static int machine_endian_longlong_map[8];
+static int big_endian_longlong_map[8];
+static int little_endian_longlong_map[8];
+#endif
+
/* {{{ php_pack
*/
static void php_pack(zval **val, int size, int *map, char *output)
@@ -98,8 +105,8 @@ static void php_pack(zval **val, int size, int *map, char *output)
}
/* }}} */
-/* pack() idea stolen from Perl (implemented formats behave the same as there)
- * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
+/* pack() idea stolen from Perl (implemented formats behave the same as there except J and P)
+ * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, q, Q, J, P, f, d, x, X, @.
*/
/* {{{ proto string pack(string format, mixed arg1 [, mixed arg2 [, mixed ...]])
Takes one or more arguments and packs them into a binary string according to the format argument */
@@ -199,6 +206,17 @@ PHP_FUNCTION(pack)
break;
/* Use as many args as specified */
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P':
+#if SIZEOF_LONG < 8
+ efree(argv);
+ efree(formatcodes);
+ efree(formatargs);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
+ RETURN_FALSE;
+#endif
case 'c':
case 'C':
case 's':
@@ -283,6 +301,15 @@ PHP_FUNCTION(pack)
INC_OUTPUTPOS(arg,4) /* 32 bit per arg */
break;
+#if SIZEOF_LONG > 4
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P':
+ INC_OUTPUTPOS(arg,8) /* 32 bit per arg */
+ break;
+#endif
+
case 'f':
INC_OUTPUTPOS(arg,sizeof(float))
break;
@@ -437,6 +464,27 @@ PHP_FUNCTION(pack)
break;
}
+#if SIZEOF_LONG > 4
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P': {
+ int *map = machine_endian_longlong_map;
+
+ if (code == 'J') {
+ map = big_endian_longlong_map;
+ } else if (code == 'P') {
+ map = little_endian_longlong_map;
+ }
+
+ while (arg-- > 0) {
+ php_pack(argv[currentarg++], 8, map, &output[outputpos]);
+ outputpos += 8;
+ }
+ break;
+ }
+#endif
+
case 'f': {
float v;
@@ -522,7 +570,7 @@ static long php_unpack(char *data, int size, int issigned, int *map)
* chars1, chars2, and ints.
* Numeric pack types will return numbers, a and A will return strings,
* f and d will return doubles.
- * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, f, d, x, X, @.
+ * Implemented formats are Z, A, a, h, H, c, C, s, S, i, I, l, L, n, N, q, Q, J, P, f, d, x, X, @.
*/
/* {{{ proto array unpack(string format, string input)
Unpack binary string into named array elements according to format argument */
@@ -637,6 +685,20 @@ PHP_FUNCTION(unpack)
size = 4;
break;
+ /* Use 8 bytes of input */
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P':
+#if SIZEOF_LONG > 4
+ size = 8;
+ break;
+#else
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "64-bit format codes are not available for 32-bit versions of PHP");
+ zval_dtor(return_value);
+ RETURN_FALSE;
+#endif
+
/* Use sizeof(float) bytes of input */
case 'f':
size = sizeof(float);
@@ -860,6 +922,38 @@ PHP_FUNCTION(unpack)
break;
}
+#if SIZEOF_LONG > 4
+ case 'q':
+ case 'Q':
+ case 'J':
+ case 'P': {
+ int issigned = 0;
+ int *map = machine_endian_longlong_map;
+ long v = 0;
+
+ if (type == 'q' || type == 'Q') {
+ issigned = input[inputpos + (machine_little_endian ? 7 : 0)] & 0x80;
+ } else if (type == 'J') {
+ issigned = input[inputpos] & 0x80;
+ map = big_endian_longlong_map;
+ } else if (type == 'P') {
+ issigned = input[inputpos + 7] & 0x80;
+ map = little_endian_longlong_map;
+ }
+
+ v = php_unpack(&input[inputpos], 8, issigned, map);
+
+ if (type == 'q') {
+ v = (signed long int) v;
+ } else {
+ v = (unsigned long int) v;
+ }
+
+ add_assoc_long(return_value, n, v);
+ break;
+ }
+#endif
+
case 'f': {
float v;
@@ -961,6 +1055,33 @@ PHP_MINIT_FUNCTION(pack)
little_endian_long_map[1] = 1;
little_endian_long_map[2] = 2;
little_endian_long_map[3] = 3;
+
+#if SIZEOF_LONG > 4
+ machine_endian_longlong_map[0] = 0;
+ machine_endian_longlong_map[1] = 1;
+ machine_endian_longlong_map[2] = 2;
+ machine_endian_longlong_map[3] = 3;
+ machine_endian_longlong_map[4] = 4;
+ machine_endian_longlong_map[5] = 5;
+ machine_endian_longlong_map[6] = 6;
+ machine_endian_longlong_map[7] = 7;
+ big_endian_longlong_map[0] = 7;
+ big_endian_longlong_map[1] = 6;
+ big_endian_longlong_map[2] = 5;
+ big_endian_longlong_map[3] = 4;
+ big_endian_longlong_map[4] = 3;
+ big_endian_longlong_map[5] = 2;
+ big_endian_longlong_map[6] = 1;
+ big_endian_longlong_map[7] = 0;
+ little_endian_longlong_map[0] = 0;
+ little_endian_longlong_map[1] = 1;
+ little_endian_longlong_map[2] = 2;
+ little_endian_longlong_map[3] = 3;
+ little_endian_longlong_map[4] = 4;
+ little_endian_longlong_map[5] = 5;
+ little_endian_longlong_map[6] = 6;
+ little_endian_longlong_map[7] = 7;
+#endif
}
else {
zval val;
@@ -993,6 +1114,33 @@ PHP_MINIT_FUNCTION(pack)
little_endian_long_map[1] = size - 2;
little_endian_long_map[2] = size - 3;
little_endian_long_map[3] = size - 4;
+
+#if SIZEOF_LONG > 4
+ machine_endian_longlong_map[0] = size - 8;
+ machine_endian_longlong_map[1] = size - 7;
+ machine_endian_longlong_map[2] = size - 6;
+ machine_endian_longlong_map[3] = size - 5;
+ machine_endian_longlong_map[0] = size - 4;
+ machine_endian_longlong_map[1] = size - 3;
+ machine_endian_longlong_map[2] = size - 2;
+ machine_endian_longlong_map[3] = size - 1;
+ big_endian_longlong_map[0] = size - 8;
+ big_endian_longlong_map[1] = size - 7;
+ big_endian_longlong_map[2] = size - 6;
+ big_endian_longlong_map[3] = size - 5;
+ big_endian_longlong_map[0] = size - 4;
+ big_endian_longlong_map[1] = size - 3;
+ big_endian_longlong_map[2] = size - 2;
+ big_endian_longlong_map[3] = size - 1;
+ little_endian_longlong_map[0] = size - 1;
+ little_endian_longlong_map[1] = size - 2;
+ little_endian_longlong_map[2] = size - 3;
+ little_endian_longlong_map[3] = size - 4;
+ little_endian_longlong_map[0] = size - 5;
+ little_endian_longlong_map[1] = size - 6;
+ little_endian_longlong_map[2] = size - 7;
+ little_endian_longlong_map[3] = size - 8;
+#endif
}
return SUCCESS;
diff --git a/ext/standard/tests/serialize/bug68044.phpt b/ext/standard/tests/serialize/bug68044.phpt
new file mode 100644
index 0000000000..031e44e149
--- /dev/null
+++ b/ext/standard/tests/serialize/bug68044.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Bug #68044 Integer overflow in unserialize() (32-bits only)
+--FILE--
+<?php
+ echo unserialize('C:3:"XYZ":18446744075857035259:{}');
+?>
+===DONE==
+--EXPECTF--
+Warning: Insufficient data for unserializing - %d required, 1 present in %s/bug68044.php on line 2
+
+Notice: unserialize(): Error at offset 32 of 33 bytes in %s/bug68044.php on line 2
+===DONE==
diff --git a/ext/standard/tests/streams/proc_open_bug51800.phpt b/ext/standard/tests/streams/proc_open_bug51800.phpt
new file mode 100644
index 0000000000..53cafd8555
--- /dev/null
+++ b/ext/standard/tests/streams/proc_open_bug51800.phpt
@@ -0,0 +1,95 @@
+--TEST--
+Bug #51800 proc_open on Windows hangs forever
+--SKIPIF--
+<?php
+ echo 'skip expected to fail or take too long';
+ if (getenv("SKIP_SLOW_TESTS")) {
+ die("skip slow test");
+ }
+?>
+--XFAIL--
+pipes have to be read/written simultaneously
+--FILE--
+<?php
+/* This is the wrong way to do it. The parent will block till it has read all the STDIN.
+The smaller the pipe buffer is, the longer it will take. It might even pass at the end,
+after taking inappropriately long. Pipes have to be read simultaneously in smaller chunks,
+so then the pipe buffer is emptied more often and the child has chance to continue its
+write. The behaviour might look some better if write/read in a separate thread, however
+this is much more resource greedy and complexer to integrate into the user script. */
+
+$callee = dirname(__FILE__) . "/process_proc_open_bug51800.php";
+$php = PHP_BINARY;
+$cmd = "$php $callee";
+
+$status;
+$stdout = "";
+$stderr = "";
+$pipes = array();
+
+$descriptors = array(
+ 0 => array("pipe", "rb"), // stdin
+ 1 => array("pipe", "wb"), // stdout
+ 2 => array("pipe", "wb") // stderr
+ );
+
+/* create the proc file */
+$r = file_put_contents($callee, '<?php
+
+$how_much = 10000;
+
+$data0 = str_repeat("a", $how_much);
+$data1 = str_repeat("b", $how_much);
+fwrite(STDOUT, $data0);
+fwrite(STDERR, $data1);
+
+exit(0);
+');
+
+if (!$r) {
+ die("couldn't create helper script '$callee'");
+}
+
+$process = proc_open($cmd, $descriptors, $pipes);
+
+if (is_resource($process))
+{
+ fclose($pipes[0]);
+
+ while (!feof($pipes[1]))
+ $stdout .= fread($pipes[1], 1024);
+ fclose($pipes[1]);
+
+ while (!feof($pipes[2]))
+ $stderr .= fread($pipes[2], 1024);
+ fclose($pipes[2]);
+
+ $status = proc_close($process);
+}
+
+var_dump(array(
+ "status" => $status,
+ "stdout" => $stdout,
+ "stderr" => $stderr,
+), strlen($stdout), strlen($stderr));
+
+?>
+===DONE===
+--CLEAN--
+<?php
+$callee = dirname(__FILE__) . "/process_proc_open_bug51800.php";
+unlink($callee);
+?>
+--EXPECTF--
+array(3) {
+ ["status"]=>
+ int(0)
+ ["stdout"]=>
+ string(10000) "a%s"
+ ["stderr"]=>
+ string(10000) "b%s"
+}
+int(10000)
+int(10000)
+===DONE===
+
diff --git a/ext/standard/tests/streams/proc_open_bug51800_right.phpt b/ext/standard/tests/streams/proc_open_bug51800_right.phpt
new file mode 100644
index 0000000000..b14fed2e5d
--- /dev/null
+++ b/ext/standard/tests/streams/proc_open_bug51800_right.phpt
@@ -0,0 +1,78 @@
+--TEST--
+Bug #51800 proc_open on Windows hangs forever, the right way to do it
+--FILE--
+<?php
+$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right.php";
+$php = PHP_BINARY;
+$cmd = "$php $callee";
+
+$status;
+$stdout = "";
+$stderr = "";
+$pipes = array();
+
+$descriptors = array(
+ 0 => array("pipe", "rb"), // stdin
+ 1 => array("pipe", "wb"), // stdout
+ 2 => array("pipe", "wb") // stderr
+ );
+
+/* create the proc file */
+$r = file_put_contents($callee, '<?php
+
+$how_much = 10000;
+
+$data0 = str_repeat("a", $how_much);
+$data1 = str_repeat("b", $how_much);
+fwrite(STDOUT, $data0);
+fwrite(STDERR, $data1);
+
+exit(0);
+');
+
+if (!$r) {
+ die("couldn't create helper script '$callee'");
+}
+
+$process = proc_open($cmd, $descriptors, $pipes);
+
+if (is_resource($process))
+{
+ fclose($pipes[0]);
+
+ while (!feof($pipes[1]) || !feof($pipes[2])) {
+ $stdout .= fread($pipes[1], 1024);
+ $stderr .= fread($pipes[2], 1024);
+ }
+ fclose($pipes[1]);
+ fclose($pipes[2]);
+
+ $status = proc_close($process);
+}
+
+var_dump(array(
+ "status" => $status,
+ "stdout" => $stdout,
+ "stderr" => $stderr,
+), strlen($stdout), strlen($stderr));
+
+?>
+===DONE===
+--CLEAN--
+<?php
+$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right.php";
+unlink($callee);
+?>
+--EXPECTF--
+array(3) {
+ ["status"]=>
+ int(0)
+ ["stdout"]=>
+ string(10000) "a%s"
+ ["stderr"]=>
+ string(10000) "b%s"
+}
+int(10000)
+int(10000)
+===DONE===
+
diff --git a/ext/standard/tests/streams/proc_open_bug51800_right2.phpt b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt
new file mode 100644
index 0000000000..1e742745c1
--- /dev/null
+++ b/ext/standard/tests/streams/proc_open_bug51800_right2.phpt
@@ -0,0 +1,84 @@
+--TEST--
+Bug #51800 proc_open on Windows hangs forever, the right way to do it with more data
+--FILE--
+<?php
+$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right2.php";
+$php = PHP_BINARY;
+$cmd = "$php $callee";
+
+$status;
+$stdout = "";
+$stderr = "";
+$pipes = array();
+
+$descriptors = array(
+ 0 => array("pipe", "rb"), // stdin
+ 1 => array("pipe", "wb"), // stdout
+ 2 => array("pipe", "wb") // stderr
+ );
+
+/* create the proc file */
+$r = file_put_contents($callee, '<?php
+$how_much = 1000000;
+
+$data0 = str_repeat("a", $how_much);
+$data1 = str_repeat("b", $how_much);
+$i0 = $i1 = 0;
+$step = 1024;
+
+while ($i0 < strlen($data0) && $i1 < strlen($data1)) {
+ fwrite(STDOUT, substr($data0, $i0, $step));
+ fwrite(STDERR, substr($data1, $i1, $step));
+ $i0 += $step;
+ $i1 += $step;
+}
+
+exit(0);
+');
+
+if (!$r) {
+ die("couldn't create helper script '$callee'");
+}
+
+$process = proc_open($cmd, $descriptors, $pipes);
+
+if (is_resource($process))
+{
+ fclose($pipes[0]);
+
+ while (!feof($pipes[1]) || !feof($pipes[2])) {
+ $stdout .= fread($pipes[1], 1024);
+ $stderr .= fread($pipes[2], 1024);
+ }
+ fclose($pipes[1]);
+ fclose($pipes[2]);
+
+ $status = proc_close($process);
+}
+
+var_dump(array(
+ "status" => $status,
+ "stdout" => $stdout,
+ "stderr" => $stderr,
+), strlen($stdout), strlen($stderr));
+
+?>
+===DONE===
+--CLEAN--
+<?php
+$callee = dirname(__FILE__) . "/process_proc_open_bug51800_right2.php";
+unlink($callee);
+?>
+--EXPECTF--
+array(3) {
+ ["status"]=>
+ int(0)
+ ["stdout"]=>
+ string(1000000) "a%s"
+ ["stderr"]=>
+ string(1000000) "b%s"
+}
+int(1000000)
+int(1000000)
+===DONE===
+
diff --git a/ext/standard/tests/streams/proc_open_bug60120.phpt b/ext/standard/tests/streams/proc_open_bug60120.phpt
new file mode 100644
index 0000000000..8768257a2e
--- /dev/null
+++ b/ext/standard/tests/streams/proc_open_bug60120.phpt
@@ -0,0 +1,71 @@
+--TEST--
+Bug #60120 proc_open hangs with stdin/out with 2048+ bytes
+--FILE--
+<?php
+error_reporting(E_ALL);
+
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+} else {
+ $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\'';
+}
+$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w'));
+$stdin = str_repeat('*', 1024 * 16) . '!';
+$stdin = str_repeat('*', 2049 );
+
+$options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false));
+$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options);
+
+foreach ($pipes as $pipe) {
+ stream_set_blocking($pipe, false);
+}
+$writePipes = array($pipes[0]);
+$stdinLen = strlen($stdin);
+$stdinOffset = 0;
+
+unset($pipes[0]);
+
+while ($pipes || $writePipes) {
+ $r = $pipes;
+ $w = $writePipes;
+ $e = null;
+ $n = stream_select($r, $w, $e, 60);
+
+ if (false === $n) {
+ break;
+ } elseif ($n === 0) {
+ proc_terminate($process);
+
+ }
+ if ($w) {
+ $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192);
+ if (false !== $written) {
+ $stdinOffset += $written;
+ }
+ if ($stdinOffset >= $stdinLen) {
+ fclose($writePipes[0]);
+ $writePipes = null;
+ }
+ }
+
+ foreach ($r as $pipe) {
+ $type = array_search($pipe, $pipes);
+ $data = fread($pipe, 8192);
+ var_dump($data);
+ if (false === $data || feof($pipe)) {
+ fclose($pipe);
+ unset($pipes[$type]);
+ }
+ }
+}
+
+
+?>
+===DONE===
+--EXPECTF--
+string(2049) "%s"
+string(2049) "%s"
+string(0) ""
+string(0) ""
+===DONE===
+
diff --git a/ext/standard/tests/streams/proc_open_bug64438.phpt b/ext/standard/tests/streams/proc_open_bug64438.phpt
new file mode 100644
index 0000000000..b3857d09d4
--- /dev/null
+++ b/ext/standard/tests/streams/proc_open_bug64438.phpt
@@ -0,0 +1,70 @@
+--TEST--
+Bug #64438 proc_open hangs with stdin/out with 4097+ bytes
+--FILE--
+<?php
+
+error_reporting(E_ALL);
+
+if (substr(PHP_OS, 0, 3) == 'WIN') {
+ $cmd = PHP_BINARY . ' -n -r "fwrite(STDOUT, $in = file_get_contents(\'php://stdin\')); fwrite(STDERR, $in);"';
+} else {
+ $cmd = PHP_BINARY . ' -n -r \'fwrite(STDOUT, $in = file_get_contents("php://stdin")); fwrite(STDERR, $in);\'';
+}
+$descriptors = array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w'));
+$stdin = str_repeat('*', 4097);
+
+$options = array_merge(array('suppress_errors' => true, 'binary_pipes' => true, 'bypass_shell' => false));
+$process = proc_open($cmd, $descriptors, $pipes, getcwd(), array(), $options);
+
+foreach ($pipes as $pipe) {
+ stream_set_blocking($pipe, false);
+}
+$writePipes = array($pipes[0]);
+$stdinLen = strlen($stdin);
+$stdinOffset = 0;
+
+unset($pipes[0]);
+
+while ($pipes || $writePipes) {
+ $r = $pipes;
+ $w = $writePipes;
+ $e = null;
+ $n = stream_select($r, $w, $e, 60);
+
+ if (false === $n) {
+ break;
+ } elseif ($n === 0) {
+ proc_terminate($process);
+
+ }
+ if ($w) {
+ $written = fwrite($writePipes[0], (binary)substr($stdin, $stdinOffset), 8192);
+ if (false !== $written) {
+ $stdinOffset += $written;
+ }
+ if ($stdinOffset >= $stdinLen) {
+ fclose($writePipes[0]);
+ $writePipes = null;
+ }
+ }
+
+ foreach ($r as $pipe) {
+ $type = array_search($pipe, $pipes);
+ $data = fread($pipe, 8192);
+ var_dump($data);
+ if (false === $data || feof($pipe)) {
+ fclose($pipe);
+ unset($pipes[$type]);
+ }
+ }
+}
+
+?>
+===DONE===
+--EXPECTF--
+string(4097) "%s"
+string(4097) "%s"
+string(0) ""
+string(0) ""
+===DONE===
+
diff --git a/ext/standard/tests/strings/pack64.phpt b/ext/standard/tests/strings/pack64.phpt
new file mode 100644
index 0000000000..9bc24928fe
--- /dev/null
+++ b/ext/standard/tests/strings/pack64.phpt
@@ -0,0 +1,115 @@
+--TEST--
+64bit pack()/unpack() tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE < 8) {
+ die("skip 64bit test only");
+}
+?>
+--FILE--
+<?php
+print_r(unpack("Q", pack("Q", 0xfffffffffffe)));
+print_r(unpack("Q", pack("Q", 0)));
+print_r(unpack("Q", pack("Q", 0x8000000000000002)));
+print_r(unpack("Q", pack("Q", -1)));
+print_r(unpack("Q", pack("Q", 0x8000000000000000)));
+
+print_r(unpack("J", pack("J", 0xfffffffffffe)));
+print_r(unpack("J", pack("J", 0)));
+print_r(unpack("J", pack("J", 0x8000000000000002)));
+print_r(unpack("J", pack("J", -1)));
+print_r(unpack("J", pack("J", 0x8000000000000000)));
+
+print_r(unpack("P", pack("P", 0xfffffffffffe)));
+print_r(unpack("P", pack("P", 0)));
+print_r(unpack("P", pack("P", 0x8000000000000002)));
+print_r(unpack("P", pack("P", -1)));
+print_r(unpack("P", pack("P", 0x8000000000000000)));
+
+print_r(unpack("q", pack("q", 0xfffffffffffe)));
+print_r(unpack("q", pack("q", 0)));
+print_r(unpack("q", pack("q", 0x8000000000000002)));
+print_r(unpack("q", pack("q", -1)));
+print_r(unpack("q", pack("q", 0x8000000000000000)));
+?>
+--EXPECTF--
+Array
+(
+ [1] => 281474976710654
+)
+Array
+(
+ [1] => 0
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => -1
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => 281474976710654
+)
+Array
+(
+ [1] => 0
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => -1
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => 281474976710654
+)
+Array
+(
+ [1] => 0
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => -1
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => 281474976710654
+)
+Array
+(
+ [1] => 0
+)
+Array
+(
+ [1] => -9223372036854775808
+)
+Array
+(
+ [1] => -1
+)
+Array
+(
+ [1] => -9223372036854775808
+)
diff --git a/ext/standard/tests/strings/pack64_32.phpt b/ext/standard/tests/strings/pack64_32.phpt
new file mode 100644
index 0000000000..f52de63ca4
--- /dev/null
+++ b/ext/standard/tests/strings/pack64_32.phpt
@@ -0,0 +1,44 @@
+--TEST--
+64bit pack()/unpack() tests
+--SKIPIF--
+<?php
+if (PHP_INT_SIZE > 4) {
+ die("skip 32bit test only");
+}
+?>
+--FILE--
+<?php
+var_dump(pack("Q", 0));
+var_dump(pack("J", 0));
+var_dump(pack("P", 0));
+var_dump(pack("q", 0));
+
+var_dump(unpack("Q", ''));
+var_dump(unpack("J", ''));
+var_dump(unpack("P", ''));
+var_dump(unpack("q", ''));
+?>
+--EXPECTF--
+Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: pack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
+
+Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in %s on line %d
+bool(false)
diff --git a/ext/standard/tests/strings/setlocale_variation2.phpt b/ext/standard/tests/strings/setlocale_variation2.phpt
index 038ba58c5e..5ebdfe8d50 100644
--- a/ext/standard/tests/strings/setlocale_variation2.phpt
+++ b/ext/standard/tests/strings/setlocale_variation2.phpt
@@ -18,8 +18,11 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
/* setlocale() to set all available locales in the system and check the success count */
echo "*** Testing setlocale() : usage variations ***\n";
-function good_locale($locale) {
- return $locale !== 'tt_RU@iqtelif.UTF-8';
+function good_locale($locale) {
+ /**
+ * Note: no_NO is a bogus locale and should not be used, see https://bugzilla.redhat.com/971416
+ **/
+ return $locale !== 'tt_RU@iqtelif.UTF-8' && $locale !== 'no_NO.ISO-8859-1';
}
/* Prototype : array list_system_locales( void )
diff --git a/ext/standard/tests/strings/url_t.phpt b/ext/standard/tests/strings/url_t.phpt
index e0e5411036..e172061ec2 100644
--- a/ext/standard/tests/strings/url_t.phpt
+++ b/ext/standard/tests/strings/url_t.phpt
@@ -75,6 +75,7 @@ $sample_urls = array (
);
foreach ($sample_urls as $url) {
+ echo "\n--> $url: ";
var_dump(@parse_url($url));
}
@@ -84,21 +85,24 @@ $sample_urls = array (
}
?>
--EXPECT--
-array(1) {
+--> : array(1) {
["path"]=>
string(0) ""
}
-array(1) {
+
+--> 64.246.30.37: array(1) {
["path"]=>
string(12) "64.246.30.37"
}
-array(2) {
+
+--> http://64.246.30.37: array(2) {
["scheme"]=>
string(4) "http"
["host"]=>
string(12) "64.246.30.37"
}
-array(3) {
+
+--> http://64.246.30.37/: array(3) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -106,11 +110,13 @@ array(3) {
["path"]=>
string(1) "/"
}
-array(1) {
+
+--> 64.246.30.37/: array(1) {
["path"]=>
string(13) "64.246.30.37/"
}
-array(3) {
+
+--> 64.246.30.37:80/: array(3) {
["host"]=>
string(12) "64.246.30.37"
["port"]=>
@@ -118,21 +124,25 @@ array(3) {
["path"]=>
string(1) "/"
}
-array(1) {
+
+--> php.net: array(1) {
["path"]=>
string(7) "php.net"
}
-array(1) {
+
+--> php.net/: array(1) {
["path"]=>
string(8) "php.net/"
}
-array(2) {
+
+--> http://php.net: array(2) {
["scheme"]=>
string(4) "http"
["host"]=>
string(7) "php.net"
}
-array(3) {
+
+--> http://php.net/: array(3) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -140,21 +150,25 @@ array(3) {
["path"]=>
string(1) "/"
}
-array(1) {
+
+--> www.php.net: array(1) {
["path"]=>
string(11) "www.php.net"
}
-array(1) {
+
+--> www.php.net/: array(1) {
["path"]=>
string(12) "www.php.net/"
}
-array(2) {
+
+--> http://www.php.net: array(2) {
["scheme"]=>
string(4) "http"
["host"]=>
string(11) "www.php.net"
}
-array(3) {
+
+--> http://www.php.net/: array(3) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -162,13 +176,15 @@ array(3) {
["path"]=>
string(1) "/"
}
-array(2) {
+
+--> www.php.net:80: array(2) {
["host"]=>
string(11) "www.php.net"
["port"]=>
int(80)
}
-array(3) {
+
+--> http://www.php.net:80: array(3) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -176,7 +192,8 @@ array(3) {
["port"]=>
int(80)
}
-array(4) {
+
+--> http://www.php.net:80/: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -186,7 +203,8 @@ array(4) {
["path"]=>
string(1) "/"
}
-array(3) {
+
+--> http://www.php.net/index.php: array(3) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -194,11 +212,13 @@ array(3) {
["path"]=>
string(10) "/index.php"
}
-array(1) {
+
+--> www.php.net/?: array(1) {
["path"]=>
string(12) "www.php.net/"
}
-array(3) {
+
+--> www.php.net:80/?: array(3) {
["host"]=>
string(11) "www.php.net"
["port"]=>
@@ -206,7 +226,8 @@ array(3) {
["path"]=>
string(1) "/"
}
-array(3) {
+
+--> http://www.php.net/?: array(3) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -214,7 +235,8 @@ array(3) {
["path"]=>
string(1) "/"
}
-array(4) {
+
+--> http://www.php.net:80/?: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -224,7 +246,8 @@ array(4) {
["path"]=>
string(1) "/"
}
-array(4) {
+
+--> http://www.php.net:80/index.php: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -234,7 +257,8 @@ array(4) {
["path"]=>
string(10) "/index.php"
}
-array(4) {
+
+--> http://www.php.net:80/foo/bar/index.php: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -244,7 +268,8 @@ array(4) {
["path"]=>
string(18) "/foo/bar/index.php"
}
-array(4) {
+
+--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -254,7 +279,8 @@ array(4) {
["path"]=>
string(53) "/this/is/a/very/deep/directory/structure/and/file.php"
}
-array(5) {
+
+--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php?lots=1&of=2&parameters=3&too=4&here=5: array(5) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -266,7 +292,8 @@ array(5) {
["query"]=>
string(37) "lots=1&of=2&parameters=3&too=4&here=5"
}
-array(4) {
+
+--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -276,7 +303,8 @@ array(4) {
["path"]=>
string(45) "/this/is/a/very/deep/directory/structure/and/"
}
-array(4) {
+
+--> http://www.php.net:80/this/is/a/very/deep/directory/structure/and/file.php: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -286,7 +314,8 @@ array(4) {
["path"]=>
string(53) "/this/is/a/very/deep/directory/structure/and/file.php"
}
-array(4) {
+
+--> http://www.php.net:80/this/../a/../deep/directory: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -296,7 +325,8 @@ array(4) {
["path"]=>
string(28) "/this/../a/../deep/directory"
}
-array(4) {
+
+--> http://www.php.net:80/this/../a/../deep/directory/: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -306,7 +336,8 @@ array(4) {
["path"]=>
string(29) "/this/../a/../deep/directory/"
}
-array(4) {
+
+--> http://www.php.net:80/this/is/a/very/deep/directory/../file.php: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -316,7 +347,8 @@ array(4) {
["path"]=>
string(42) "/this/is/a/very/deep/directory/../file.php"
}
-array(4) {
+
+--> http://www.php.net:80/index.php: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -326,7 +358,8 @@ array(4) {
["path"]=>
string(10) "/index.php"
}
-array(4) {
+
+--> http://www.php.net:80/index.php?: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -336,7 +369,8 @@ array(4) {
["path"]=>
string(10) "/index.php"
}
-array(5) {
+
+--> http://www.php.net:80/#foo: array(5) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -348,7 +382,8 @@ array(5) {
["fragment"]=>
string(3) "foo"
}
-array(4) {
+
+--> http://www.php.net:80/?#: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -358,7 +393,8 @@ array(4) {
["path"]=>
string(1) "/"
}
-array(5) {
+
+--> http://www.php.net:80/?test=1: array(5) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -370,7 +406,8 @@ array(5) {
["query"]=>
string(6) "test=1"
}
-array(4) {
+
+--> http://www.php.net/?test=1&: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -380,7 +417,8 @@ array(4) {
["query"]=>
string(7) "test=1&"
}
-array(5) {
+
+--> http://www.php.net:80/?&: array(5) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -392,7 +430,8 @@ array(5) {
["query"]=>
string(1) "&"
}
-array(5) {
+
+--> http://www.php.net:80/index.php?test=1&: array(5) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -404,7 +443,8 @@ array(5) {
["query"]=>
string(7) "test=1&"
}
-array(4) {
+
+--> http://www.php.net/index.php?&: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -414,7 +454,8 @@ array(4) {
["query"]=>
string(1) "&"
}
-array(5) {
+
+--> http://www.php.net:80/index.php?foo&: array(5) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -426,7 +467,8 @@ array(5) {
["query"]=>
string(4) "foo&"
}
-array(4) {
+
+--> http://www.php.net/index.php?&foo: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -436,7 +478,8 @@ array(4) {
["query"]=>
string(4) "&foo"
}
-array(5) {
+
+--> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI: array(5) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -448,7 +491,8 @@ array(5) {
["query"]=>
string(31) "test=1&test2=char&test3=mixesCI"
}
-array(5) {
+
+--> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(5) {
["host"]=>
string(11) "www.php.net"
["port"]=>
@@ -460,7 +504,8 @@ array(5) {
["fragment"]=>
string(16) "some_page_ref123"
}
-array(7) {
+
+--> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -476,13 +521,16 @@ array(7) {
["fragment"]=>
string(16) "some_page_ref123"
}
-array(6) {
+
+--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) {
["scheme"]=>
string(4) "http"
["host"]=>
string(11) "www.php.net"
["user"]=>
string(6) "secret"
+ ["pass"]=>
+ string(0) ""
["path"]=>
string(10) "/index.php"
["query"]=>
@@ -490,13 +538,16 @@ array(6) {
["fragment"]=>
string(16) "some_page_ref123"
}
-array(7) {
+
+--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) {
["scheme"]=>
string(4) "http"
["host"]=>
string(11) "www.php.net"
["port"]=>
int(80)
+ ["user"]=>
+ string(0) ""
["pass"]=>
string(7) "hideout"
["path"]=>
@@ -506,7 +557,8 @@ array(7) {
["fragment"]=>
string(16) "some_page_ref123"
}
-array(7) {
+
+--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -522,7 +574,8 @@ array(7) {
["fragment"]=>
string(16) "some_page_ref123"
}
-array(7) {
+
+--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -538,7 +591,8 @@ array(7) {
["fragment"]=>
string(16) "some_page_ref123"
}
-array(8) {
+
+--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -556,13 +610,15 @@ array(8) {
["fragment"]=>
string(16) "some_page_ref123"
}
-array(2) {
+
+--> nntp://news.php.net: array(2) {
["scheme"]=>
string(4) "nntp"
["host"]=>
string(12) "news.php.net"
}
-array(3) {
+
+--> ftp://ftp.gnu.org/gnu/glic/glibc.tar.gz: array(3) {
["scheme"]=>
string(3) "ftp"
["host"]=>
@@ -570,25 +626,29 @@ array(3) {
["path"]=>
string(22) "/gnu/glic/glibc.tar.gz"
}
-array(2) {
+
+--> zlib:http://foo@bar: array(2) {
["scheme"]=>
string(4) "zlib"
["path"]=>
string(14) "http://foo@bar"
}
-array(2) {
+
+--> zlib:filename.txt: array(2) {
["scheme"]=>
string(4) "zlib"
["path"]=>
string(12) "filename.txt"
}
-array(2) {
+
+--> zlib:/path/to/my/file/file.txt: array(2) {
["scheme"]=>
string(4) "zlib"
["path"]=>
string(25) "/path/to/my/file/file.txt"
}
-array(3) {
+
+--> foo://foo@bar: array(3) {
["scheme"]=>
string(3) "foo"
["host"]=>
@@ -596,25 +656,29 @@ array(3) {
["user"]=>
string(3) "foo"
}
-array(2) {
+
+--> mailto:me@mydomain.com: array(2) {
["scheme"]=>
string(6) "mailto"
["path"]=>
string(15) "me@mydomain.com"
}
-array(2) {
+
+--> /foo.php?a=b&c=d: array(2) {
["path"]=>
string(8) "/foo.php"
["query"]=>
string(7) "a=b&c=d"
}
-array(2) {
+
+--> foo.php?a=b&c=d: array(2) {
["path"]=>
string(7) "foo.php"
["query"]=>
string(7) "a=b&c=d"
}
-array(6) {
+
+--> http://user:passwd@www.example.com:8080?bar=1&boom=0: array(6) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -628,13 +692,15 @@ array(6) {
["query"]=>
string(12) "bar=1&boom=0"
}
-array(2) {
+
+--> file:///path/to/file: array(2) {
["scheme"]=>
string(4) "file"
["path"]=>
string(13) "/path/to/file"
}
-array(3) {
+
+--> file://path/to/file: array(3) {
["scheme"]=>
string(4) "file"
["host"]=>
@@ -642,13 +708,15 @@ array(3) {
["path"]=>
string(8) "/to/file"
}
-array(2) {
+
+--> file:/path/to/file: array(2) {
["scheme"]=>
string(4) "file"
["path"]=>
string(13) "/path/to/file"
}
-array(4) {
+
+--> http://1.2.3.4:/abc.asp?a=1&b=2: array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -658,7 +726,8 @@ array(4) {
["query"]=>
string(7) "a=1&b=2"
}
-array(3) {
+
+--> http://foo.com#bar: array(3) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -666,11 +735,13 @@ array(3) {
["fragment"]=>
string(3) "bar"
}
-array(1) {
+
+--> scheme:: array(1) {
["scheme"]=>
string(6) "scheme"
}
-array(4) {
+
+--> foo+bar://baz@bang/bla: array(4) {
["scheme"]=>
string(7) "foo+bar"
["host"]=>
@@ -680,13 +751,15 @@ array(4) {
["path"]=>
string(4) "/bla"
}
-array(2) {
+
+--> gg:9130731: array(2) {
["scheme"]=>
string(2) "gg"
["path"]=>
string(7) "9130731"
}
-array(7) {
+
+--> http://user:@pass@host/path?argument?value#etc: array(7) {
["scheme"]=>
string(4) "http"
["host"]=>
@@ -710,3 +783,4 @@ string(7) "hideout"
string(10) "/index.php"
string(31) "test=1&test2=char&test3=mixesCI"
string(16) "some_page_ref123"
+
diff --git a/ext/standard/tests/url/parse_url_basic_001.phpt b/ext/standard/tests/url/parse_url_basic_001.phpt
index a6f4f7a252..0708691fe3 100644
--- a/ext/standard/tests/url/parse_url_basic_001.phpt
+++ b/ext/standard/tests/url/parse_url_basic_001.phpt
@@ -454,13 +454,15 @@ echo "Done";
string(16) "some_page_ref123"
}
---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(6) {
+--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) {
["scheme"]=>
string(4) "http"
["host"]=>
string(11) "www.php.net"
["user"]=>
string(6) "secret"
+ ["pass"]=>
+ string(0) ""
["path"]=>
string(10) "/index.php"
["query"]=>
@@ -469,13 +471,15 @@ echo "Done";
string(16) "some_page_ref123"
}
---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(7) {
+--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123: array(8) {
["scheme"]=>
string(4) "http"
["host"]=>
string(11) "www.php.net"
["port"]=>
int(80)
+ ["user"]=>
+ string(0) ""
["pass"]=>
string(7) "hideout"
["path"]=>
diff --git a/ext/standard/tests/url/parse_url_basic_005.phpt b/ext/standard/tests/url/parse_url_basic_005.phpt
index 1fc946e5b3..5b2cb98f8b 100644
--- a/ext/standard/tests/url/parse_url_basic_005.phpt
+++ b/ext/standard/tests/url/parse_url_basic_005.phpt
@@ -66,7 +66,7 @@ echo "Done";
--> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL
--> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret"
--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret"
---> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL
+--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(0) ""
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret"
--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(14) "secret@hideout"
--> http://secret:hid:out@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(6) "secret"
diff --git a/ext/standard/tests/url/parse_url_basic_006.phpt b/ext/standard/tests/url/parse_url_basic_006.phpt
index 5104326198..79af6b8b62 100644
--- a/ext/standard/tests/url/parse_url_basic_006.phpt
+++ b/ext/standard/tests/url/parse_url_basic_006.phpt
@@ -65,7 +65,7 @@ echo "Done";
--> http://www.php.net:80/index.php?test=1&test2=char&test3=mixesCI : NULL
--> www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL
--> http://secret@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL
---> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL
+--> http://secret:@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(0) ""
--> http://:hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout"
--> http://secret:hideout@www.php.net/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : string(7) "hideout"
--> http://secret@hideout@www.php.net:80/index.php?test=1&test2=char&test3=mixesCI#some_page_ref123 : NULL
diff --git a/ext/standard/url.c b/ext/standard/url.c
index fe1b2fe112..06c72e483f 100644
--- a/ext/standard/url.c
+++ b/ext/standard/url.c
@@ -240,16 +240,12 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
/* check for login and password */
if ((p = zend_memrchr(s, '@', (e-s)))) {
if ((pp = memchr(s, ':', (p-s)))) {
- if ((pp-s) > 0) {
- ret->user = estrndup(s, (pp-s));
- php_replace_controlchars_ex(ret->user, (pp - s));
- }
+ ret->user = estrndup(s, (pp-s));
+ php_replace_controlchars_ex(ret->user, (pp - s));
pp++;
- if (p-pp > 0) {
- ret->pass = estrndup(pp, (p-pp));
- php_replace_controlchars_ex(ret->pass, (p-pp));
- }
+ ret->pass = estrndup(pp, (p-pp));
+ php_replace_controlchars_ex(ret->pass, (p-pp));
} else {
ret->user = estrndup(s, (p-s));
php_replace_controlchars_ex(ret->user, (p-s));
diff --git a/ext/standard/var_unserializer.c b/ext/standard/var_unserializer.c
index 8b5392a9d7..8b51a20ace 100644
--- a/ext/standard/var_unserializer.c
+++ b/ext/standard/var_unserializer.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Fri Apr 18 15:07:27 2014 */
+/* Generated by re2c 0.13.5 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
@@ -371,7 +371,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
(*p) += 2;
- if (datalen < 0 || (*p) + datalen >= max) {
+ if (datalen < 0 || (max - (*p)) <= datalen) {
zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p)));
return 0;
}
diff --git a/ext/standard/var_unserializer.re b/ext/standard/var_unserializer.re
index 3a1b910953..ef553ffb53 100644
--- a/ext/standard/var_unserializer.re
+++ b/ext/standard/var_unserializer.re
@@ -375,7 +375,7 @@ static inline int object_custom(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
(*p) += 2;
- if (datalen < 0 || (*p) + datalen >= max) {
+ if (datalen < 0 || (max - (*p)) <= datalen) {
zend_error(E_WARNING, "Insufficient data for unserializing - %ld required, %ld present", datalen, (long)(max - (*p)));
return 0;
}
diff --git a/ext/sysvsem/sysvsem.c b/ext/sysvsem/sysvsem.c
index c30def8ba5..fce70b9e02 100644
--- a/ext/sysvsem/sysvsem.c
+++ b/ext/sysvsem/sysvsem.c
@@ -66,6 +66,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_acquire, 0, 0, 1)
ZEND_ARG_INFO(0, sem_identifier)
+ ZEND_ARG_INFO(0, nowait)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_sem_release, 0, 0, 1)
@@ -298,11 +299,18 @@ PHP_FUNCTION(sem_get)
static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
{
zval *arg_id;
+ zend_bool nowait = 0;
sysvsem_sem *sem_ptr;
struct sembuf sop;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) {
- return;
+ if (acquire) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &arg_id, &nowait) == FAILURE) {
+ return;
+ }
+ } else {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &arg_id) == FAILURE) {
+ return;
+ }
}
ZEND_FETCH_RESOURCE(sem_ptr, sysvsem_sem *, &arg_id, -1, "SysV semaphore", php_sysvsem_module.le_sem);
@@ -314,11 +322,13 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
sop.sem_num = SYSVSEM_SEM;
sop.sem_op = acquire ? -1 : 1;
- sop.sem_flg = SEM_UNDO;
+ sop.sem_flg = SEM_UNDO | (nowait ? IPC_NOWAIT : 0);
while (semop(sem_ptr->semid, &sop, 1) == -1) {
if (errno != EINTR) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
+ if (errno != EAGAIN) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to %s key 0x%x: %s", acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
+ }
RETURN_FALSE;
}
}
diff --git a/ext/sysvsem/tests/nowait.phpt b/ext/sysvsem/tests/nowait.phpt
new file mode 100644
index 0000000000..0a6fdf4a50
--- /dev/null
+++ b/ext/sysvsem/tests/nowait.phpt
@@ -0,0 +1,103 @@
+--TEST--
+sem_acquire with nowait
+--SKIPIF--
+<?php // vim600: ts=4 sw=4 syn=php fdm=marker
+if(!extension_loaded('sysvsem') || !extension_loaded('pcntl')) {
+ die("skip sysvsem and pcntl required");
+}
+?>
+--FILE--
+<?php
+$SEMKEY = ftok(__FILE__, 'P'); // Semaphore key
+
+$pid = pcntl_fork();
+
+if ($pid) {
+ echo "Parent.\n";
+
+ pcntl_signal(SIGCHLD, SIG_IGN);
+
+ // Get semaphore
+ $sem_id = sem_get($SEMKEY, 1);
+ if ($sem_id === FALSE) {
+ echo "P: fail to get semaphore";
+ exit;
+ }
+ echo "P: got semaphore $sem_id.\n";
+
+ register_shutdown_function(function () use ($sem_id) {
+ echo "P: cleanup.\n";
+ sem_remove($sem_id);
+ });
+
+ // Acquire semaphore
+ if (! sem_acquire($sem_id)) {
+ echo "P: fail to acquire semaphore $sem_id.\n";
+ sem_remove($sem_id);
+ exit;
+ }
+ echo "P: success acquire semaphore $sem_id.\n";
+
+ usleep(20000);
+
+ echo "P: releases.\n";
+ sem_release($sem_id);
+
+ usleep(5000);
+
+ // Acquire semaphore
+ if (! sem_acquire($sem_id)) {
+ echo "P: fail to acquire semaphore $sem_id.\n";
+ sem_remove($sem_id);
+ exit;
+ }
+ echo "P: success acquire semaphore $sem_id.\n";
+
+ $status = null;
+ pcntl_waitpid($pid, $status);
+
+} else {
+ usleep(10000);
+ echo "Child.\n";
+
+ // Get semaphore
+ $sem_id = sem_get($SEMKEY, 1);
+ if ($sem_id === FALSE) {
+ echo "C: fail to get semaphore";
+ exit;
+ }
+ echo "C: got semaphore $sem_id.\n";
+
+ // Acquire semaphore
+ if (! sem_acquire($sem_id)) {
+ echo "C: fail to acquire semaphore $sem_id.\n";
+ exit;
+ }
+ echo "C: success acquire semaphore $sem_id.\n";
+
+ echo "C: releases.\n";
+ sem_release($sem_id);
+
+ usleep(10000);
+
+ // Acquire semaphore
+ if (! sem_acquire($sem_id, true)) {
+ echo "C: fail to acquire semaphore $sem_id.\n";
+ exit;
+ }
+ echo "C: success acquire semaphore $sem_id.\n";
+}
+
+?>
+--EXPECTF--
+Parent.
+P: got semaphore Resource id #%i.
+P: success acquire semaphore Resource id #%i.
+Child.
+C: got semaphore Resource id #%i.
+P: releases.
+C: success acquire semaphore Resource id #%i.
+C: releases.
+P: success acquire semaphore Resource id #%i.
+C: fail to acquire semaphore Resource id #%i.
+P: cleanup.
diff --git a/ext/sysvsem/tests/sysv.phpt b/ext/sysvsem/tests/sysv.phpt
index 6f52f3bd7e..ccfcf03d32 100644
--- a/ext/sysvsem/tests/sysv.phpt
+++ b/ext/sysvsem/tests/sysv.phpt
@@ -9,8 +9,8 @@ if(!extension_loaded('sysvsem') || !extension_loaded('sysvshm')) {
--FILE--
<?php
$MEMSIZE = 512; // size of shared memory to allocate
-$SEMKEY = 1; // Semaphore key
-$SHMKEY = 2; // Shared memory key
+$SEMKEY = ftok(__FILE__, 'P'); // Semaphore key
+$SHMKEY = ftok(__FILE__, 'Q'); // Shared memory key
echo "Start.\n";
// Get semaphore
diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.c b/ext/xmlrpc/libxmlrpc/xmlrpc.c
index ce70c2afd9..b766a5495a 100644
--- a/ext/xmlrpc/libxmlrpc/xmlrpc.c
+++ b/ext/xmlrpc/libxmlrpc/xmlrpc.c
@@ -219,16 +219,19 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_mon = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+4])
tm.tm_mon += (text[i+4]-'0')*n;
n /= 10;
}
tm.tm_mon --;
+ if(tm.tm_mon < 0 || tm.tm_mon > 11) {
+ return -1;
+ }
n = 10;
tm.tm_mday = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+6])
tm.tm_mday += (text[i+6]-'0')*n;
n /= 10;
}
@@ -236,7 +239,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_hour = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+9])
tm.tm_hour += (text[i+9]-'0')*n;
n /= 10;
}
@@ -244,7 +247,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_min = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+12])
tm.tm_min += (text[i+12]-'0')*n;
n /= 10;
}
@@ -252,7 +255,7 @@ static int date_from_ISO8601 (const char *text, time_t * value) {
n = 10;
tm.tm_sec = 0;
for(i = 0; i < 2; i++) {
- XMLRPC_IS_NUMBER(text[i])
+ XMLRPC_IS_NUMBER(text[i+15])
tm.tm_sec += (text[i+15]-'0')*n;
n /= 10;
}
diff --git a/ext/xmlrpc/tests/bug68027.phpt b/ext/xmlrpc/tests/bug68027.phpt
new file mode 100644
index 0000000000..a5c96f1cf2
--- /dev/null
+++ b/ext/xmlrpc/tests/bug68027.phpt
@@ -0,0 +1,44 @@
+--TEST--
+Bug #68027 (buffer overflow in mkgmtime() function)
+--SKIPIF--
+<?php
+if (!extension_loaded("xmlrpc")) print "skip";
+?>
+--FILE--
+<?php
+
+$d = '6-01-01 20:00:00';
+xmlrpc_set_type($d, 'datetime');
+var_dump($d);
+$datetime = "2001-0-08T21:46:40-0400";
+$obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>");
+print_r($obj);
+
+$datetime = "34770-0-08T21:46:40-0400";
+$obj = xmlrpc_decode("<?xml version=\"1.0\"?><methodResponse><params><param><value><dateTime.iso8601>$datetime</dateTime.iso8601></value></param></params></methodResponse>");
+print_r($obj);
+
+echo "Done\n";
+?>
+--EXPECTF--
+object(stdClass)#1 (3) {
+ ["scalar"]=>
+ string(16) "6-01-01 20:00:00"
+ ["xmlrpc_type"]=>
+ string(8) "datetime"
+ ["timestamp"]=>
+ int(%d)
+}
+stdClass Object
+(
+ [scalar] => 2001-0-08T21:46:40-0400
+ [xmlrpc_type] => datetime
+ [timestamp] => %s
+)
+stdClass Object
+(
+ [scalar] => 34770-0-08T21:46:40-0400
+ [xmlrpc_type] => datetime
+ [timestamp] => %d
+)
+Done
diff --git a/main/php_streams.h b/main/php_streams.h
index e90976cdca..d1efa71988 100644
--- a/main/php_streams.h
+++ b/main/php_streams.h
@@ -297,9 +297,6 @@ PHPAPI size_t _php_stream_write(php_stream *stream, const char *buf, size_t coun
#define php_stream_write_string(stream, str) _php_stream_write(stream, str, strlen(str) TSRMLS_CC)
#define php_stream_write(stream, buf, count) _php_stream_write(stream, (buf), (count) TSRMLS_CC)
-PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC);
-#define php_stream_fill_read_buffer(stream, size) _php_stream_fill_read_buffer((stream), (size) TSRMLS_CC)
-
#ifdef ZTS
PHPAPI size_t _php_stream_printf(php_stream *stream TSRMLS_DC, const char *fmt, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
#else
diff --git a/main/php_variables.c b/main/php_variables.c
index 90cfcb20bc..b2df88be61 100644
--- a/main/php_variables.c
+++ b/main/php_variables.c
@@ -241,7 +241,7 @@ typedef struct post_var_data {
static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSRMLS_DC)
{
- char *ksep, *vsep;
+ char *ksep, *vsep, *val;
size_t klen, vlen;
/* FIXME: string-size_t */
unsigned int new_vlen;
@@ -272,15 +272,17 @@ static zend_bool add_post_var(zval *arr, post_var_data_t *var, zend_bool eof TSR
vlen = 0;
}
-
php_url_decode(var->ptr, klen);
+
+ val = estrndup(ksep, vlen);
if (vlen) {
- vlen = php_url_decode(ksep, vlen);
+ vlen = php_url_decode(val, vlen);
}
- if (sapi_module.input_filter(PARSE_POST, var->ptr, &ksep, vlen, &new_vlen TSRMLS_CC)) {
- php_register_variable_safe(var->ptr, ksep, new_vlen, arr TSRMLS_CC);
+ if (sapi_module.input_filter(PARSE_POST, var->ptr, &val, vlen, &new_vlen TSRMLS_CC)) {
+ php_register_variable_safe(var->ptr, val, new_vlen, arr TSRMLS_CC);
}
+ efree(val);
var->ptr = vsep + (vsep != var->end);
return 1;
diff --git a/main/php_version.h b/main/php_version.h
index 8e6b2b86ac..be8584d14a 100644
--- a/main/php_version.h
+++ b/main/php_version.h
@@ -2,7 +2,7 @@
/* edit configure.in to change version number */
#define PHP_MAJOR_VERSION 5
#define PHP_MINOR_VERSION 6
-#define PHP_RELEASE_VERSION 1
+#define PHP_RELEASE_VERSION 3
#define PHP_EXTRA_VERSION "-dev"
-#define PHP_VERSION "5.6.1-dev"
-#define PHP_VERSION_ID 50601
+#define PHP_VERSION "5.6.3-dev"
+#define PHP_VERSION_ID 50603
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 87312b9ef8..69c6a3ce26 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -342,6 +342,34 @@ static size_t php_stdiop_read(php_stream *stream, char *buf, size_t count TSRMLS
assert(data != NULL);
if (data->fd >= 0) {
+#ifdef PHP_WIN32
+ php_stdio_stream_data *self = (php_stdio_stream_data*)stream->abstract;
+
+ if (self->is_pipe || self->is_process_pipe) {
+ HANDLE ph = (HANDLE)_get_osfhandle(data->fd);
+ int retry = 0;
+ DWORD avail_read = 0;
+
+ do {
+ /* Look ahead to get the available data amount to read. Do the same
+ as read() does, however not blocking forever. In case it failed,
+ no data will be read (better than block). */
+ if (!PeekNamedPipe(ph, NULL, 0, NULL, &avail_read, NULL)) {
+ break;
+ }
+ /* If there's nothing to read, wait in 100ms periods. */
+ if (0 == avail_read) {
+ usleep(100000);
+ }
+ } while (0 == avail_read && retry++ < 320);
+
+ /* Reduce the required data amount to what is available, otherwise read()
+ will block.*/
+ if (avail_read < count) {
+ count = avail_read;
+ }
+ }
+#endif
ret = read(data->fd, buf, count);
if (ret == (size_t)-1 && errno == EINTR) {
diff --git a/main/streams/streams.c b/main/streams/streams.c
index d0d4fffa0a..67a151014d 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -568,7 +568,7 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
/* {{{ generic stream operations */
-PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC)
+static void php_stream_fill_read_buffer(php_stream *stream, size_t size TSRMLS_DC)
{
/* allocate/fill the buffer */
@@ -736,7 +736,7 @@ PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS
break;
}
} else {
- php_stream_fill_read_buffer(stream, size);
+ php_stream_fill_read_buffer(stream, size TSRMLS_CC);
toread = stream->writepos - stream->readpos;
if (toread > size) {
@@ -972,7 +972,7 @@ PHPAPI char *_php_stream_get_line(php_stream *stream, char *buf, size_t maxlen,
}
}
- php_stream_fill_read_buffer(stream, toread);
+ php_stream_fill_read_buffer(stream, toread TSRMLS_CC);
if (stream->writepos - stream->readpos == 0) {
break;
@@ -1047,7 +1047,7 @@ PHPAPI char *php_stream_get_record(php_stream *stream, size_t maxlen, size_t *re
to_read_now = MIN(maxlen - buffered_len, stream->chunk_size);
- php_stream_fill_read_buffer(stream, buffered_len + to_read_now);
+ php_stream_fill_read_buffer(stream, buffered_len + to_read_now TSRMLS_CC);
just_read = STREAM_BUFFERED_AMOUNT(stream) - buffered_len;
diff --git a/php.ini-development b/php.ini-development
index 148d194fef..bcc9ac6baf 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -1765,7 +1765,7 @@ mssql.secure_connection = Off
;mbstring.encoding_translation = Off
; automatic encoding detection order.
-; "auto" detect order is changed accoding to mbstring.language
+; "auto" detect order is changed according to mbstring.language
; http://php.net/mbstring.detect-order
;mbstring.detect_order = auto
diff --git a/php.ini-production b/php.ini-production
index 5410b3de54..a2a50ea2f8 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -1763,7 +1763,7 @@ mssql.secure_connection = Off
;mbstring.encoding_translation = Off
; automatic encoding detection order.
-; "auto" detect order is changed accoding to mbstring.language
+; "auto" detect order is changed according to mbstring.language
; http://php.net/mbstring.detect-order
;mbstring.detect_order = auto
diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c
index 8ddc2e4577..6133668306 100644
--- a/sapi/cgi/fastcgi.c
+++ b/sapi/cgi/fastcgi.c
@@ -1112,7 +1112,7 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
shutdown(req->fd, 1);
/* read the last FCGI_STDIN header (it may be omitted) */
- recv(req->fd, &buf, sizeof(buf), 0);
+ recv(req->fd, (char *)(&buf), sizeof(buf), 0);
}
closesocket(req->fd);
}
@@ -1122,7 +1122,7 @@ static inline void fcgi_close(fcgi_request *req, int force, int destroy)
shutdown(req->fd, 1);
/* read the last FCGI_STDIN header (it may be omitted) */
- recv(req->fd, &buf, sizeof(buf), 0);
+ recv(req->fd, (char *)(&buf), sizeof(buf), 0);
}
close(req->fd);
#endif
diff --git a/sapi/cli/tests/016.phpt b/sapi/cli/tests/016.phpt
index 31c1a40e4a..9c28d15a30 100644
--- a/sapi/cli/tests/016.phpt
+++ b/sapi/cli/tests/016.phpt
@@ -59,8 +59,6 @@ foreach ($codes as $key => $code) {
echo "\nDone\n";
?>
---XFAIL--
-https://bugs.php.net/bug.php?id=55496
--EXPECTF--
--------------
Snippet no. 1:
diff --git a/sapi/fpm/fpm/fpm_main.c b/sapi/fpm/fpm/fpm_main.c
index cd5492d73d..5b96dee038 100644
--- a/sapi/fpm/fpm/fpm_main.c
+++ b/sapi/fpm/fpm/fpm_main.c
@@ -1237,6 +1237,17 @@ static void init_request_info(TSRMLS_D)
SG(request_info).request_uri = orig_script_name;
}
path_info[0] = old;
+ } else if (apache_was_here && env_script_name) {
+ /* Using mod_proxy_fcgi and ProxyPass, apache cannot set PATH_INFO
+ * As we can extract PATH_INFO from PATH_TRANSLATED
+ * it is probably also in SCRIPT_NAME and need to be removed
+ */
+ int snlen = strlen(env_script_name);
+ if (snlen>slen && !strcmp(env_script_name+snlen-slen, path_info)) {
+ _sapi_cgibin_putenv("ORIG_SCRIPT_NAME", orig_script_name TSRMLS_CC);
+ env_script_name[snlen-slen] = 0;
+ SG(request_info).request_uri = _sapi_cgibin_putenv("SCRIPT_NAME", env_script_name TSRMLS_CC);
+ }
}
env_path_info = _sapi_cgibin_putenv("PATH_INFO", path_info TSRMLS_CC);
}
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index e056565ea4..da14d63d8c 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -39,29 +39,6 @@ struct listening_socket_s {
static struct fpm_array_s sockets_list;
-static int fpm_sockets_resolve_af_inet(char *node, char *service, struct sockaddr_in *addr) /* {{{ */
-{
- struct addrinfo *res;
- struct addrinfo hints;
- int ret;
-
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = AF_INET;
- ret = getaddrinfo(node, service, &hints, &res);
-
- if (ret != 0) {
- zlog(ZLOG_ERROR, "can't resolve hostname '%s%s%s': getaddrinfo said: %s%s%s\n",
- node, service ? ":" : "", service ? service : "",
- gai_strerror(ret), ret == EAI_SYSTEM ? ", system error: " : "", ret == EAI_SYSTEM ? strerror(errno) : "");
- return -1;
- }
-
- *addr = *(struct sockaddr_in *) res->ai_addr;
- freeaddrinfo(res);
- return 0;
-}
-/* }}} */
-
enum { FPM_GET_USE_SOCKET = 1, FPM_STORE_SOCKET = 2, FPM_STORE_USE_SOCKET = 3 };
static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */
@@ -98,14 +75,23 @@ static void fpm_sockets_cleanup(int which, void *arg) /* {{{ */
}
/* }}} */
+static void *fpm_get_in_addr(struct sockaddr *sa) /* {{{ */
+{
+ if (sa->sa_family == AF_INET) {
+ return &(((struct sockaddr_in*)sa)->sin_addr);
+ }
+
+ return &(((struct sockaddr_in6*)sa)->sin6_addr);
+}
+/* }}} */
+
static int fpm_sockets_hash_op(int sock, struct sockaddr *sa, char *key, int type, int op) /* {{{ */
{
if (key == NULL) {
switch (type) {
case FPM_AF_INET : {
- struct sockaddr_in *sa_in = (struct sockaddr_in *) sa;
- key = alloca(sizeof("xxx.xxx.xxx.xxx:ppppp"));
- sprintf(key, "%u.%u.%u.%u:%u", IPQUAD(&sa_in->sin_addr), (unsigned int) ntohs(sa_in->sin_port));
+ key = alloca(INET6_ADDRSTRLEN);
+ inet_ntop(sa->sa_family, fpm_get_in_addr(sa), key, sizeof key);
break;
}
@@ -254,11 +240,14 @@ enum fpm_address_domain fpm_sockets_domain_from_address(char *address) /* {{{ */
static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /* {{{ */
{
- struct sockaddr_in sa_in;
+ struct addrinfo hints, *servinfo, *p;
char *dup_address = strdup(wp->config->listen_address);
- char *port_str = strchr(dup_address, ':');
+ char *port_str = strrchr(dup_address, ':');
char *addr = NULL;
+ int addr_len;
int port = 0;
+ int sock;
+ int status;
if (port_str) { /* this is host:port pair */
*port_str++ = '\0';
@@ -274,23 +263,35 @@ static int fpm_socket_af_inet_listening_socket(struct fpm_worker_pool_s *wp) /*
return -1;
}
- memset(&sa_in, 0, sizeof(sa_in));
-
- if (addr) {
- sa_in.sin_addr.s_addr = inet_addr(addr);
- if (sa_in.sin_addr.s_addr == INADDR_NONE) { /* do resolve */
- if (0 > fpm_sockets_resolve_af_inet(addr, NULL, &sa_in)) {
- return -1;
- }
- zlog(ZLOG_NOTICE, "address '%s' resolved as %u.%u.%u.%u", addr, IPQUAD(&sa_in.sin_addr));
+ // strip brackets from address for getaddrinfo
+ if (addr != NULL) {
+ addr_len = strlen(addr);
+ if (addr[0] == '[' && addr[addr_len - 1] == ']') {
+ addr[addr_len - 1] = '\0';
+ addr++;
}
- } else {
- sa_in.sin_addr.s_addr = htonl(INADDR_ANY);
}
- sa_in.sin_family = AF_INET;
- sa_in.sin_port = htons(port);
+
+ memset(&hints, 0, sizeof hints);
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+
+ if ((status = getaddrinfo(addr, port_str, &hints, &servinfo)) != 0) {
+ zlog(ZLOG_ERROR, "getaddrinfo: %s\n", gai_strerror(status));
+ return -1;
+ }
+
free(dup_address);
- return fpm_sockets_get_listening_socket(wp, (struct sockaddr *) &sa_in, sizeof(struct sockaddr_in));
+
+ for (p = servinfo; p != NULL; p = p->ai_next) {
+ if ((sock = fpm_sockets_get_listening_socket(wp, p->ai_addr, p->ai_addrlen)) != -1) {
+ break;
+ }
+ }
+
+ freeaddrinfo(servinfo);
+
+ return sock;
}
/* }}} */
diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h
index 121c016a7b..446c78e410 100644
--- a/sapi/fpm/fpm/fpm_sockets.h
+++ b/sapi/fpm/fpm/fpm_sockets.h
@@ -45,10 +45,4 @@ static inline int fd_set_blocked(int fd, int blocked) /* {{{ */
}
/* }}} */
-#define IPQUAD(sin_addr) \
- (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[0], \
- (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[1], \
- (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[2], \
- (unsigned int) ((unsigned char *) &(sin_addr)->s_addr)[3]
-
#endif
diff --git a/sapi/fpm/php-fpm.conf.in b/sapi/fpm/php-fpm.conf.in
index c5f4abc59c..631bc46f42 100644
--- a/sapi/fpm/php-fpm.conf.in
+++ b/sapi/fpm/php-fpm.conf.in
@@ -152,6 +152,8 @@ group = @php_fpm_group@
; Valid syntaxes are:
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
; a specific port;
+; '[ip:6:addr:ess]:port' - to listen on a TCP socket to a specific IPv6 address on
+; a specific port;
; 'port' - to listen on a TCP socket to all addresses on a
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
diff --git a/sapi/fpm/tests/003.phpt b/sapi/fpm/tests/003.phpt
new file mode 100644
index 0000000000..389cb2401e
--- /dev/null
+++ b/sapi/fpm/tests/003.phpt
@@ -0,0 +1,53 @@
+--TEST--
+FPM: Test IPv6 support
+--SKIPIF--
+<?php include "skipif.inc"; ?>
+--FILE--
+<?php
+
+include "include.inc";
+
+$logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+
+$cfg = <<<EOT
+[global]
+error_log = $logfile
+[unconfined]
+listen = [::1]:9000
+pm = dynamic
+pm.max_children = 5
+pm.start_servers = 2
+pm.min_spare_servers = 1
+pm.max_spare_servers = 3
+EOT;
+
+$fpm = run_fpm($cfg, $tail);
+if (is_resource($fpm)) {
+ var_dump(fgets($tail));
+ var_dump(fgets($tail));
+ $i = 0;
+ while (($i++ < 30) && !($fp = fsockopen('[::1]', 9000))) {
+ usleep(10000);
+ }
+ if ($fp) {
+ echo "Done\n";
+ fclose($fp);
+ }
+ proc_terminate($fpm);
+ stream_get_contents($tail);
+ fclose($tail);
+ proc_close($fpm);
+}
+
+?>
+--EXPECTF--
+string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: fpm is running, pid %d
+"
+string(%d) "[%d-%s-%d %d:%d:%d] NOTICE: ready to handle connections
+"
+Done
+--CLEAN--
+<?php
+ $logfile = dirname(__FILE__).'/php-fpm.log.tmp';
+ @unlink($logfile);
+?>
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index cb7c66b44a..425d638f9e 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -69,7 +69,7 @@
#define SAPI_LSAPI_MAX_HEADER_LENGTH 2048
-static int lsapi_mode = 1;
+static int lsapi_mode = 0;
static char *php_self = "";
static char *script_filename = "";
static int source_highlight = 0;
@@ -311,6 +311,8 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC)
if ( (SG(request_info).request_uri ) )
php_self = (SG(request_info).request_uri );
+ litespeed_php_import_environment_variables(track_vars_array TSRMLS_CC);
+
#if ((PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION < 4) || PHP_MAJOR_VERSION < 5)
if (!PG(magic_quotes_gpc)) {
#endif
@@ -324,7 +326,6 @@ static void sapi_lsapi_register_variables(zval *track_vars_array TSRMLS_DC)
add_variable_magic_quote("PHP_SELF", 8, php_self, strlen( php_self ), track_vars_array );
}
#endif
- litespeed_php_import_environment_variables(track_vars_array TSRMLS_CC);
} else {
php_import_environment_variables(track_vars_array TSRMLS_CC);
@@ -1052,6 +1053,7 @@ int main( int argc, char * argv[] )
LSAPI_Init();
LSAPI_Init_Env_Parameters( NULL );
+ lsapi_mode = 1;
slow_script_msec = LSAPI_Get_Slow_Req_Msecs();
diff --git a/sapi/phpdbg/.travis.yml b/sapi/phpdbg/.travis.yml
index d5b492e7cf..2e777fbe13 100644
--- a/sapi/phpdbg/.travis.yml
+++ b/sapi/phpdbg/.travis.yml
@@ -4,7 +4,6 @@ env:
- PHP="PHP-5.4"
- PHP="PHP-5.5"
- PHP="PHP-5.6"
-- PHP="master"
before_script: ./travis/ci.sh
diff --git a/sapi/phpdbg/README.md b/sapi/phpdbg/README.md
index e7e5c731a8..a2a84deb7b 100644
--- a/sapi/phpdbg/README.md
+++ b/sapi/phpdbg/README.md
@@ -1,7 +1,7 @@
The interactive PHP debugger
============================
-Implemented as a SAPI module, phpdbg can excert complete control over the environment without impacting the functionality or performance of your code.
+Implemented as a SAPI module, phpdbg can exert complete control over the environment without impacting the functionality or performance of your code.
phpdbg aims to be a lightweight, powerful, easy to use debugging platform for PHP 5.4+
diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c
index 1fbd18a423..c881559e6e 100644
--- a/sapi/phpdbg/phpdbg.c
+++ b/sapi/phpdbg/phpdbg.c
@@ -1296,14 +1296,14 @@ phpdbg_main:
/* do not install sigint handlers for remote consoles */
/* sending SIGINT then provides a decent way of shutting down the server */
-#if defined(ZEND_SIGNALS) && !defined(_WIN32)
- if (listen[0] < 0) {
- zend_try { zend_signal(SIGINT, phpdbg_sigint_handler TSRMLS_CC); } zend_end_try();
- }
-#elif !defined(_WIN32)
+#ifndef _WIN32
if (listen[0] < 0) {
#endif
+#if defined(ZEND_SIGNALS) && !defined(_WIN32)
+ zend_try { zend_signal(SIGINT, phpdbg_sigint_handler TSRMLS_CC); } zend_end_try();
+#else
signal(SIGINT, phpdbg_sigint_handler);
+#endif
#ifndef _WIN32
}
#endif