Compare commits

..
223 Commits
Author SHA1 Message Date
Stanislav Malyshev 73915a2bd6 Fix bug #74087
Ported from https://vcs.pcre.org/pcre/code/trunk/pcre_jit_compile.c?r1=1676&r2=1680&view=patch
2017-07-06 09:49:28 +01:00
Nikita Popov 61ba5f8477 Fixed bug #74111 2017-07-06 09:48:52 +01:00
Joe Watkins 498aa0ec97 news entry for 74819 2017-07-06 09:32:12 +01:00
Derick Rethans 2c74a57118 Fixed parsing of strange formats with mixed month/day and time strings 2017-07-06 09:26:15 +01:00
Joe Watkins 77072a0946 news entry for 74651 2017-07-06 08:34:49 +01:00
Stanislav Malyshev 91826a311d Fix bug #74651 - check EVP_SealInit as it can return -1 2017-07-06 08:25:09 +01:00
Joe Watkins ec664bd26d news entry for 74603 2017-07-06 08:18:27 +01:00
Joe Watkins a938133d89 news entry for 74111 2017-07-06 08:17:33 +01:00
Joe Watkins 53b7c63c5e news entry for 74435 2017-07-06 08:15:12 +01:00
Christoph M. Becker 0180921255 Fix #74435: Buffer over-read into uninitialized memory
The stack allocated color map buffers were not zeroed before usage, and
so undefined palette indexes could cause information leakage.
2017-07-06 07:44:25 +01:00
Stanislav Malyshev 88c521d659 Fix bug #74603 - use correct buffer size 2017-07-06 07:43:43 +01:00
Remi Collet 7378e7bdc8 Adapt for 32-bits which fails at different offset (49 vs 38) 2017-07-06 07:02:17 +01:00
Anatol Belski d9b0835dfd fix datatype 2017-07-06 07:01:53 +01:00
Joe Watkins ef9d35cdc9 set versions 2017-07-04 20:10:59 +01:00
Anatol Belski 2c567eae28 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74101 and bug #74614
2017-07-04 20:07:00 +01:00
Joe Watkins 3d7b2117e0 set versions for 7.1.7RC1 2017-06-20 17:29:01 +01:00
Anatol Belski 67f063e3ac Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Split requested size as expected by CreateFileMapping.
2017-06-20 15:45:05 +02:00
Anatol Belski 6a854e2740 Split requested size as expected by CreateFileMapping.
Thus fixing ext\opcache\tests\log_verbosity_bug.phpt fails on 64-bit.
2017-06-20 15:40:25 +02:00
Anatol Belski 3f2cfac5d6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  move next
2017-06-20 14:06:27 +02:00
Anatol Belski b4fa2ba295 move next 2017-06-20 14:05:50 +02:00
Christopher Jones 3303e87101 Update NEWS 2017-06-20 16:01:37 +10:00
Christopher Jones 7ecddd2c24 Merge branch 'PHP-7.0' into PHP-7.1 2017-06-20 16:00:55 +10:00
Christopher Jones 27d6814351 PDO_OCI: support IC 12.2 in configure option 2017-06-20 16:00:22 +10:00
Christopher Jones f39c9d8345 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Bump OCI8 version
2017-06-20 14:55:27 +10:00
Christopher Jones 64447030bb Bump OCI8 version 2017-06-20 14:54:45 +10:00
Christopher Jones b1431c6174 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  add test for bug #70700
2017-06-20 14:44:11 +10:00
Christopher Jones 073ac50374 Merge branch 'pull-request/1569' into PHP-7.0
* pull-request/1569:
  add test for bug #70700
2017-06-20 14:43:50 +10:00
Chuck Burgess 98bcc0bd43 add test for bug #70700 2017-06-20 14:43:20 +10:00
Christopher Jones 82bb98ce1a Update NEWS 2017-06-20 14:37:52 +10:00
Christopher Jones 135265ef69 Update NEWS 2017-06-20 14:37:16 +10:00
Christopher Jones b742a18ba4 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  oci8 - Implementation of Oracle TAF Callback
2017-06-20 14:33:35 +10:00
Christopher Jones ec6ac50812 Merge branch 'pull-request/2459' into PHP-7.0
* pull-request/2459:
  oci8 - Implementation of Oracle TAF Callback
2017-06-20 14:33:06 +10:00
KoenigsKind 1b797f7ad3 oci8 - Implementation of Oracle TAF Callback
Adds support for the Transparent Application Failover Callback.
The php_oci_connection struct got a char* added which will contain the
callback function, it should be set to PHP_OCI_TAF_DISABLE_CALLBACK at
the end of a php request for permanent connections so that, if a TAF
callback occurs, no userspace function will be called.
Maybe add support for registering object functions (via array),
currently the register function only accepts a string. I didn't know how
to implement it correctly. As a failover occurs very rarely it might be
better to not keep the cache when saving the zend_fcall_info.

Things to do
[ ] config.m4 needs to compile oci8_failover.c
[ ] Check if correctly implemented (especially for multithreading)
[ ] Add support for registering callback function via array
2017-06-20 14:32:52 +10:00
Christopher Jones 058bec9e33 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  add test for bug #60994
2017-06-20 14:24:07 +10:00
Christopher Jones a6c67a088a Merge branch 'pull-request/1566' into PHP-7.0
* pull-request/1566:
  add test for bug #60994
2017-06-20 14:23:20 +10:00
Chuck Burgess 51a7e35c24 add test for bug #60994 2017-06-20 14:22:28 +10:00
Jakub Zelenka fbb884e532 Merge branch 'PHP-7.0' into PHP-7.1 2017-06-18 19:08:51 +01:00
Jelle van der Waa 509f5097ab openssl: Add openssl_pkcs12_(read, export) tests
Add basic tests for openssl_pkcs12_read and openssl_pkcs12_export.
openssl_pkcs12_export has two tests disable which currently do not work
as intended and should be fixed.
2017-06-18 19:02:51 +01:00
Jakub Zelenka bfa9362d43 Merge branch 'PHP-7.0' into PHP-7.1 2017-06-18 18:28:54 +01:00
Jakub Zelenka 887fabe78f Regenerate and bump re2c version to 0.16
It also matches the re2c version for Zend language scanner
2017-06-18 18:26:48 +01:00
Anatol Belski 7275084388 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Next round on AppVeyor reliability.
2017-06-17 01:58:51 +02:00
Anatol Belski 4a39d33ee5 Next round on AppVeyor reliability. 2017-06-17 01:57:47 +02:00
Jakub Zelenka c2a348b5bc Merge branch 'PHP-7.0' into PHP-7.1 2017-06-16 17:14:23 +01:00
Jelle van der Waa f19dfac830 openssl: Fix spkstr and spki leak in openssl_spki_new
spkstr is not free'd when running the test and valgrind reports a leak
of 32,318 bytes. The free condition is not met since keyresource is not
NULL, apart from that OPENSSL_free actually free's the allocated memory
by OPENSSL_malloc inside OpenSSL.

Valgrind reports 768 bytes leaked in openssl_spki_new when running the
testsuite. Remove the keyresource check to always free spki.
2017-06-16 16:51:50 +01:00
Dmitry Stogov 84b9b164a8 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY)
2017-06-13 17:16:13 +03:00
Dmitry Stogov 648be8600f Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY) 2017-06-13 17:15:47 +03:00
Remi Collet 6408c66d3c NEWS 2017-06-13 08:50:24 +02:00
Remi Collet 90f33b1ac7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  NEWS
  Fix bug #74705 for collator_get_sort_key
  Fixes bug #74705 Wrong ReflectionInfo for Collator::getSortKey()
2017-06-13 08:50:10 +02:00
Remi Collet c4d7cfa536 NEWS 2017-06-13 08:50:02 +02:00
Remi Collet 78970d5338 Fix bug #74705 for collator_get_sort_key 2017-06-13 08:48:17 +02:00
Tyson Andre 5f07a895cc Fixes bug #74705 Wrong ReflectionInfo for Collator::getSortKey()
https://secure.php.net/manual/en/collator.getsortkey.php
2017-06-13 08:46:47 +02:00
Remi Collet 593d37376b NEWS 2017-06-13 08:15:19 +02:00
Remi Collet 3aa80c482c Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  NEWS
  Fixes bug #74708 reflection signatures for random_bytes+random_int
2017-06-13 08:14:57 +02:00
Remi Collet aea8c6ddc1 NEWS 2017-06-13 08:14:34 +02:00
Tyson Andre 81b2533a68 Fixes bug #74708 reflection signatures for random_bytes+random_int
They have 1 and 2 required parameters, respectively
See https://secure.php.net/manual/en/function.random-int.php
2017-06-13 08:11:25 +02:00
Xinchen Hui b7c2c44a8d Forgotten NEWs update 2017-06-13 12:21:45 +08:00
Xinchen Hui c0678be3e0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Forgotten NEWs update
2017-06-13 12:21:27 +08:00
Xinchen Hui 3968ffe7b3 Forgotten NEWs update 2017-06-13 12:20:42 +08:00
Xinchen Hui caf35c5cf5 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Add simple cli test for PATH/HOST ini sections
  Fixed bug #74600
2017-06-12 17:21:35 +08:00
Xinchen Hui e05f79c3de Merge branch 'bug74600' of https://github.com/manuelm/php-src into PHP-7.0
* 'bug74600' of https://github.com/manuelm/php-src:
  Add simple cli test for PATH/HOST ini sections
  Fixed bug #74600
2017-06-12 17:12:15 +08:00
Anatol Belski 0fa40b0546 group the change for bug #74720 2017-06-09 23:47:15 +02:00
Manuel Mausz 91f129ebf7 Add simple cli test for PATH/HOST ini sections 2017-06-09 23:28:19 +02:00
Anatol Belski 6d46528d54 update NEWS 2017-06-09 17:40:45 +02:00
Anatol Belski cbe73b3cfe Fixed bug #74720 pkcs7_en/decrypt does not work if \x1a is used in
content
2017-06-09 17:35:37 +02:00
Christoph M. Becker 1980234fc2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Use reasonable SQLite3 module version
2017-06-09 14:05:04 +02:00
Christoph M. Becker c3b910370c Use reasonable SQLite3 module version
Since PECL/sqlite3 has been moved to ext/sqlite3 in 2008, the SQLite3
module version is hardcoded to `0.7-dev`. It doesn't appear to make
much sense to have an own module version for a bundled extensions, but
as other code might rely on it, we don't remove the constant but rather
make it an alias of the PHP version.
2017-06-09 13:49:32 +02:00
Manuel Mausz ee0e6963f3 Fixed bug #74600
Make sure the hash entry is an array.

The origin fix broke support for HOST/PATH ini sections. Only the
beginning of the string has to match. Revert this check but use
zend_binary_strncasecmp instead of strncasecmp.
2017-06-09 01:43:08 +02:00
Anatol Belski 844f4292ef Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  enforce exit status propagation and up the sdk version
2017-06-08 17:16:02 +02:00
Anatol Belski 9997767dc3 enforce exit status propagation and up the sdk version 2017-06-08 17:14:52 +02:00
Remi Collet c39a10bc6e relax this test again (still encounter erratic failure) 2017-06-06 17:20:33 +02:00
Jakub Zelenka ff93f74f63 Merge branch 'PHP-7.0' into PHP-7.1 2017-06-04 18:11:49 +01:00
Jakub Zelenka 3704947696 Replace ASN1_STRING_data with ASN1_STRING_get0_data
This is a slightly modified version of the patch from Jelle van der Waa
( @jelly ) so full credit to him.
2017-06-04 18:08:51 +01:00
Nikita Popov 6af1d7ad01 Merge branch 'PHP-7.0' into PHP-7.1 2017-06-03 15:08:59 +02:00
Nikita Popov 585c9f3c4b Fix leak in WDDX serialization 2017-06-03 15:08:42 +02:00
Nikita Popov 6b511d124e Travis: Use opcache in release build
Our debug builds on Travis are often timing out recently. Opcache
causes quite a large performance hit on test run times, so move it
over to the release build, where it should have less impact.
2017-06-03 12:37:47 +02:00
Nikita Popov d9fd44366d Merge branch 'PHP-7.0' into PHP-7.1 2017-06-03 00:42:30 +02:00
Tim Toohey d027bc2add Fixed bug #69373
xmlNodeSetContentLen() calls xmlFreeNode() on node->children. This
causes problems if there are other references around to those children.
2017-06-03 00:40:58 +02:00
Nikita Popov bfedff58e3 Merge branch 'PHP-7.0' into PHP-7.1 2017-06-03 00:05:52 +02:00
libnex 95c4564f93 Fixed bug #73473: Stack Buffer Overflow in msgfmt_parse_message 2017-06-03 00:05:16 +02:00
Jelle van der Waa c742abb3ce openssl_pkcs12_read: add missing BIO_free
When filling the extracerts array with certificates bio_out is created
but not free'd leading to a small memory leak of 224 bytes (reported by
valgrind).
2017-06-02 23:52:43 +02:00
Jesper Hagström cea34425f3 Set timezone for intl/test/bug74298.phpt
Now sets UTC as default timezone for the DateTime which otherwise
uses the timezone defined in php.ini.
2017-06-02 23:40:48 +02:00
Nikita Popov e9ff1fac85 Revert "merge PR #2290: enable opcache in CLI in 7.1+"
This reverts commit 71fe529afc.

Without the file cache (which is not enabled by default), this has
non-trivial impact on the startup time. It also significantly
increases the baseline memory usage of PHP on CLI.
2017-06-02 23:36:20 +02:00
andrewnester 48598a2302 Fixed #74639 - Added proper clone functionality for DatePeriod and DateInterval 2017-06-01 08:07:11 +01:00
Xinchen Hui 741769d933 Update NEWS 2017-05-31 13:09:38 +08:00
Xinchen Hui 9064dca58b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74673 (Segfault when cast Reflection object to string with undefined constant)

Conflicts:
	ext/reflection/php_reflection.c
2017-05-31 13:08:26 +08:00
Xinchen Hui 9c5717d0de Fixed bug #74673 (Segfault when cast Reflection object to string with undefined constant) 2017-05-31 12:39:26 +08:00
Dmitry Stogov 316aaca155 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed wrong condition
2017-05-31 00:40:57 +03:00
Dmitry Stogov 77cbf8a657 Fixed wrong condition 2017-05-31 00:40:33 +03:00
Côme Bernigaud 1bb295e659 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  ext/ldap/test: Test that ldap_connect() uses defaults from ldap.conf (openldap)
  ext/ldap: Allow default host from ldap.conf to work.

Conflicts:
	ext/ldap/ldap.c
2017-05-30 16:48:16 +02:00
Côme Bernigaud dc7e53690f Merge branch 'pull-request/2536' into PHP-7.0
* pull-request/2536:
  ext/ldap/test: Test that ldap_connect() uses defaults from ldap.conf (openldap)
  ext/ldap: Allow default host from ldap.conf to work.
2017-05-30 16:45:27 +02:00
Remi Collet b11393fccb NEWS 2017-05-30 15:46:15 +02:00
Remi Collet bee52f352f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  NEWS
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/60 (CVE-2017-9228)
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/59 (CVE-2017-9229) b690371bbf97794b4a1d3f295d4fb9a8b05d402d Modified for onig 5.9.6
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/58 (CVE-2017-9227)
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/57 (CVE-2017-9224)
  Patch from the upstream git https://github.com/kkos/oniguruma/issues/55 (CVE-2017-9226) b4bf968ad52afe14e60a2dc8a95d3555c543353a Modified for onig 5.9.6 f015fbdd95f76438cd86366467bb2b39870dd7c6 Modified for onig 5.9.6
2017-05-30 15:45:52 +02:00
Remi Collet 46bb35a853 NEWS 2017-05-30 15:45:09 +02:00
Remi Collet 1c845d2950 Patch from the upstream git
https://github.com/kkos/oniguruma/issues/60 (CVE-2017-9228)

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:40:32 +02:00
Remi Collet 5416deec66 Patch from the upstream git
https://github.com/kkos/oniguruma/issues/59 (CVE-2017-9229)
b690371bbf97794b4a1d3f295d4fb9a8b05d402d Modified for onig 5.9.6

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:39:21 +02:00
Remi Collet 6a8ae7cf8d Patch from the upstream git
https://github.com/kkos/oniguruma/issues/58 (CVE-2017-9227)

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:38:17 +02:00
Remi Collet 60b1829e1c Patch from the upstream git
https://github.com/kkos/oniguruma/issues/57 (CVE-2017-9224)

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:37:11 +02:00
Remi Collet 1e0c4386ab Patch from the upstream git
https://github.com/kkos/oniguruma/issues/55 (CVE-2017-9226)
b4bf968ad52afe14e60a2dc8a95d3555c543353a Modified for onig 5.9.6
f015fbdd95f76438cd86366467bb2b39870dd7c6 Modified for onig 5.9.6

Thanks to Mamoru TASAKA <mtasaka@fedoraproject.org>
2017-05-30 15:35:42 +02:00
Fabien Villepinte d6922ef8e3 Fix Bug #74386Phar::__construct(): wrong number of parameters by reflection 2017-05-29 08:31:47 +01:00
Joe Watkins d351c199bb Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix Bug #74386 Phar::__construct(): wrong number of parameters by reflection
2017-05-29 08:29:58 +01:00
Fabien Villepinte 2dee44c74c Fix Bug #74386 Phar::__construct(): wrong number of parameters by reflection 2017-05-29 08:29:30 +01:00
Sara Golemon e628ee9e9d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Bugfix #74556 stream_socket_get_name() returns empty string
  Fix abstract name handling to be binary safe
2017-05-28 08:49:25 -07:00
Sara Golemon 8dcfec9789 Bugfix #74556 stream_socket_get_name() returns empty string
The original bug report had it returning '\0',
but with a fix to abstract name handling (6d2d0bbda7)
it now actually returns ''.

Neither of these are good, as per unix(7)
an empty socket name indicates an unbound name
and "should not be inspected".
2017-05-28 08:48:18 -07:00
Sara Golemon 6d2d0bbda7 Fix abstract name handling to be binary safe
Per unix(7):
abstract: an abstract socket address is distinguished (from a
pathname socket) by the fact that sun_path[0] is a null byte
('\0').  The socket's address in this namespace is given by the
additional bytes in sun_path that are covered by the specified
length of the address structure.  (Null bytes in the name have no
special significance.)  The name has no connection with filesystem
pathnames.  When the address of an abstract socket is returned,
the returned addrlen is greater than sizeof(sa_family_t) (i.e.,
greater than 2), and the name of the socket is contained in the
first (addrlen - sizeof(sa_family_t)) bytes of sun_path.

The existing implementation was assuming significance in null bytes
contained in the abstract address identifier.
2017-05-28 08:45:44 -07:00
Sara Golemon d9458aac9d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Bugfix #74598 ftp:// ignores context
2017-05-27 21:14:02 -07:00
Sara Golemon 05849a242a Bugfix #74598 ftp:// ignores context 2017-05-27 21:12:49 -07:00
Xinchen Hui 398efb087c Update NEWS 2017-05-27 22:43:30 +08:00
Xinchen Hui 19befb1ca2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74663 (Segfault with opcache.memory_protect and validate_timestamp)
2017-05-27 22:43:23 +08:00
Xinchen Hui 60912e66c8 Fixed bug #74663 (Segfault with opcache.memory_protect and validate_timestamp) 2017-05-27 22:42:27 +08:00
Xinchen Hui 1838f965bc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Correct the location
2017-05-27 12:12:12 +08:00
Xinchen Hui ece7d223e8 Correct the location 2017-05-27 12:11:53 +08:00
Xinchen Hui 63ca6f93a1 Added NEWs 2017-05-27 12:09:11 +08:00
Xinchen Hui cd3520c4d3 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74657 (Undefined constants in array properties result in broken properties)
2017-05-27 12:08:48 +08:00
Xinchen Hui 5269c4cacb Fixed bug #74657 (Undefined constants in array properties result in broken properties) 2017-05-27 12:06:43 +08:00
David Caldwell 49d1cdc393 ext/ldap/test: Test that ldap_connect() uses defaults from ldap.conf (openldap) 2017-05-25 21:27:11 +00:00
Derick Rethans fc87715950 Added a test case for (docs) bug #74652 2017-05-25 10:57:09 -04:00
David Caldwell d51b8f915f ext/ldap: Allow default host from ldap.conf to work.
This fixes an regression introduced in
e7af0fe1eb. Previously, calling
ldap_connect() with no parameters would pass NULL to ldap_init(),
which causes it to use the default host specified in
/etc/ldap/ldap.conf (on Ubuntu).

When the code changed to use ldap_initialize(), it initialized a uri,
even if there were no parameters passed to ldap_connect(). Because of
this, there's no way to pass a NULL into ldap_initialize(), making it
impossible to use the default uri from ldap.conf.

This commit bypasses the uri creation when there is no host argument,
passing on a NULL to ldap_initialize() which restores the old PHP 5.5
behavior.
2017-05-25 00:47:11 +00:00
Nikita Popov e7a7065024 Merge branch 'PHP-7.0' into PHP-7.1 2017-05-24 18:02:13 +02:00
jhdxr 872e43d6e5 Fixed bug #74478 2017-05-24 18:01:41 +02:00
Joe Watkins e535b80257 bump versions 2017-05-23 22:04:01 +01:00
Anatol Belski 056cb8c256 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  time to move next
2017-05-23 12:33:23 +02:00
Anatol Belski fff1cab367 time to move next 2017-05-23 12:31:03 +02:00
Anatol Belski 65bf0364b6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  move to the next sdk version for AppVeyor
2017-05-20 13:51:18 +02:00
Anatol Belski c4ae856912 move to the next sdk version for AppVeyor 2017-05-20 13:48:35 +02:00
Xinchen Hui 11b4f105bf Merge branch '74595-reflection-parameters' of https://github.com/andrewnester/php-src into PHP-7.1
* '74595-reflection-parameters' of https://github.com/andrewnester/php-src:
  Fixed #74595 - ReflectionMethod::getParameters returns incorrect number of parameters
2017-05-19 23:59:43 +08:00
Xinchen Hui 08293a960b Merge branch 'PHP-7.1' of git.php.net:/php-src into PHP-7.1
* 'PHP-7.1' of git.php.net:/php-src:
  follow up fix on bug #74022
  Fixed bug #74606 (Segfault within try/catch/finally nesting in Generators)
2017-05-19 23:56:31 +08:00
Xinchen Hui 459c382df5 Update news 2017-05-19 23:56:10 +08:00
Anatol Belski 26f217bf40 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  follow up fix on bug #74022
2017-05-18 12:07:09 +02:00
Anatol Belski 464c1639ae follow up fix on bug #74022 2017-05-18 12:03:13 +02:00
Bob Weinand 649494c0ee Fixed bug #74606 (Segfault within try/catch/finally nesting in Generators)
Thanks to Nikita for pointing out the error source.
2017-05-17 19:58:51 +02:00
Xinchen Hui 78b10dd9d6 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Added cleanup
2017-05-17 23:25:17 +08:00
Xinchen Hui 0954ea8d6d Added cleanup 2017-05-17 23:24:58 +08:00
Xinchen Hui f38487a0e0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Added test for bug #74600
2017-05-17 23:21:38 +08:00
Xinchen Hui ef09bc0645 Added test for bug #74600 2017-05-17 23:21:18 +08:00
Xinchen Hui d3e3bc611a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Added test for bug #74596
2017-05-17 22:43:03 +08:00
Xinchen Hui e347b2ded6 Added test for bug #74596 2017-05-17 22:42:18 +08:00
Anatol Belski 02e9e59beb improve error handling 2017-05-17 13:35:42 +02:00
Anatol Belski 6e3d24bcf4 fix wrong error check 2017-05-17 12:50:41 +02:00
Anatol Belski b73a73da25 fix test 2017-05-16 15:09:02 +02:00
Anatol Belski 71f8c4dcfd add test for bug #74589 2017-05-16 14:25:27 +02:00
Xinchen Hui c667bb94fa Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i)
2017-05-16 19:32:59 +08:00
Xinchen Hui 8a1713e39c Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  variation of icu libraries causes failure
2017-05-16 19:32:33 +08:00
Xinchen Hui 9f49ebb5ba Fixed bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i) 2017-05-16 19:32:13 +08:00
Anatol Belski 7d418430fd Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  variation of icu libraries causes failure
2017-05-16 12:47:24 +02:00
Steve Walk d74fbfb38f variation of icu libraries causes failure 2017-05-16 12:46:27 +02:00
Xinchen Hui 7f051ac583 Update NEWs 2017-05-16 13:23:12 +08:00
Xinchen Hui e04b91e6e2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74596 (SIGSEGV with opcache.revalidate_path enabled)
2017-05-16 13:22:43 +08:00
Xinchen Hui 89dd7fb328 Fixed bug #74596 (SIGSEGV with opcache.revalidate_path enabled)
Yeah, no test script is provided.. I got some troubles to make a one
2017-05-16 13:22:08 +08:00
Anatol Belski 8ec91086ee Revert "fixing run-tests.php for variables_order="GPCS""
This reverts commit c1d5718697.

The commit seems to be inappropriate as it contains parts from master,
which have nothing to do with the variables order issue. Obviously patch
applied to wrong branch or alike.
2017-05-15 20:34:11 +02:00
Anatol Belski b067bda4cd Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  switch to Postgres 9.6 for appveyor
2017-05-15 17:48:29 +02:00
Anatol Belski 777929b1ae switch to Postgres 9.6 for appveyor 2017-05-15 17:47:41 +02:00
Anatol Belski 42e5df141c [ci skip] update NEWS 2017-05-15 17:39:31 +02:00
Anatol Belski ae3f975c5d Fixed bug #74589 __DIR__ wrong for unicode character 2017-05-15 16:35:22 +02:00
andrewnester 2e5a747b59 Fixed #74595 - ReflectionMethod::getParameters returns incorrect number of parameters 2017-05-15 17:07:00 +03:00
Matt Ficken c1d5718697 fixing run-tests.php for variables_order="GPCS" 2017-05-15 02:21:55 -07:00
Anatol Belski 8cbfc882d2 [ci skip] update NEWS 2017-05-14 01:59:46 +02:00
Anatol Belski cfe577fb86 revert workaround for bug #74489 as it's fixed in the dependency lib 2017-05-14 01:47:40 +02:00
Sara Golemon 90bd4be3f9 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Remove typo from test header
2017-05-10 16:50:37 -07:00
Sara Golemon b8e0351978 Remove typo from test header 2017-05-10 16:50:19 -07:00
Xinchen Hui 05c90e5994 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed tests when using cumstom php.ini(session.save_handler)
  Fix Bug #74541 Wrong reflection on session_start()
2017-05-09 11:14:40 +08:00
Xinchen Hui 1b22e9dc2e Fixed tests when using cumstom php.ini(session.save_handler) 2017-05-09 11:13:41 +08:00
Xinchen Hui d40a852919 Merge branch 'fix_74541' of https://github.com/villfa/php-src into PHP-7.0
* 'fix_74541' of https://github.com/villfa/php-src:
  Fix Bug #74541 Wrong reflection on session_start()
2017-05-09 11:04:39 +08:00
Xinchen Hui 15dbe775d1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix typo: exectute => execute
2017-05-09 11:01:52 +08:00
Xinchen Hui 99549ce79c Merge branch 'patch-1' of https://github.com/ifdattic/php-src into PHP-7.0
* 'patch-1' of https://github.com/ifdattic/php-src:
  Fix typo: exectute => execute
2017-05-09 11:01:33 +08:00
Fabien Villepinte b39c70b4a7 Fix Bug #74541 Wrong reflection on session_start() 2017-05-08 22:42:09 +02:00
Anatol Belski 72073228ca Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  sync bin sdk version
2017-05-08 19:39:56 +02:00
Anatol Belski 1a06fae543 sync bin sdk version 2017-05-08 19:38:48 +02:00
Anatol Belski 83033f0b32 [ci skip] update libs_versions.txt 2017-05-08 13:11:12 +02:00
Anatol Belski bdd66e1492 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  [ci skip] update libs versions file
2017-05-08 13:10:48 +02:00
Anatol Belski ca870dfee7 [ci skip] update libs versions file 2017-05-08 13:10:13 +02:00
Andrew Marcinkevičius abad134681 Fix typo: exectute => execute 2017-05-08 13:59:05 +03:00
Xinchen Hui 2d30bc96a1 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed another potential dangling pointer
2017-05-08 11:36:29 +08:00
Xinchen Hui b966a8b5fa Fixed another potential dangling pointer 2017-05-08 11:36:07 +08:00
Xinchen Hui 62c1edf535 Update NEWS 2017-05-08 11:32:42 +08:00
Xinchen Hui 2c070847e7 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
2017-05-08 11:32:27 +08:00
Xinchen Hui 87d56a3d07 Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER()) 2017-05-08 11:32:08 +08:00
Anatol Belski 5dafb523fd [ci skip] update NEWS 2017-05-07 13:05:47 +02:00
Anatol Belski 6658b437ae Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  [ci skip] update NEWS
2017-05-07 13:05:10 +02:00
Anatol Belski 5c957b502e [ci skip] update NEWS 2017-05-07 13:04:21 +02:00
Anatol Belski 378f785515 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types
2017-05-06 15:10:16 +02:00
Anatol Belski 561f1afe6e Fixed bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types 2017-05-06 15:06:34 +02:00
Anatol Belski 4b3a11b329 [ci skip] update NEWS 2017-05-02 14:54:42 +02:00
Anatol Belski 476b7f1667 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  [ci skip] update NEWS
2017-05-02 14:54:17 +02:00
Anatol Belski 622dc2a611 [ci skip] update NEWS 2017-05-02 14:53:32 +02:00
Anatol Belski 64adba3b3f Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #51918 Phar::webPhar() does not handle requests sent through PUT and DELETE method
2017-05-02 14:46:15 +02:00
Christian Weiske c0c0871911 Fixed bug #51918 Phar::webPhar() does not handle requests sent through PUT and DELETE method
phar: Support DELETE, HEAD and PUT HTTP methods in Phar::webPhar

Up to now only GET and POST requests could be handled with Phar::webPhar(),
which is insufficient for today's REST APIs.
This patch expands the list of supported HTTP methods.
2017-05-02 14:44:47 +02:00
Anatol Belski 7431d6dda6 [ci skip] update NEWS 2017-05-02 12:39:10 +02:00
Anatol Belski f97607027a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  [ci skip] update NEWS
2017-05-02 12:38:40 +02:00
Anatol Belski 36c53036e7 [ci skip] update NEWS 2017-05-02 12:38:04 +02:00
Anatol Belski 3d9563b8b2 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #74510 win32/sendmail.c anchors CC header but not BCC
2017-05-02 12:32:40 +02:00
Anatol Belski 20a608d9da Fixed bug #74510 win32/sendmail.c anchors CC header but not BCC 2017-05-02 12:31:00 +02:00
Joe Watkins 6bd30e8f1a Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #74457 Wrong reflection on XMLReader::expand
2017-05-02 06:25:21 +01:00
Fabien Villepinte 4c0e50c88a Fix bug #74457 Wrong reflection on XMLReader::expand 2017-05-02 06:24:46 +01:00
Joe Watkins 2735318c7b Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fix bug #74468 wrong reflection on Collator::sortWithSortKeys
2017-05-02 06:21:54 +01:00
Fabien Villepinte f50df1d0e3 Fix bug #74468 wrong reflection on Collator::sortWithSortKeys 2017-05-02 06:20:40 +01:00
Anatol Belski 023cbdb2ca Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Tests to ensure BC with undocumented behavior used in hacks
2017-05-01 18:06:09 +02:00
Anatol Belski a581e64199 Tests to ensure BC with undocumented behavior used in hacks
Should become obsolete, once behaviors change.
2017-05-01 18:01:05 +02:00
Nikita Popov e3f411c9f7 Merge branch 'PHP-7.0' into PHP-7.1 2017-05-01 12:15:41 +02:00
Nikita Popov 1967950dc3 Fix typo in SplFixedArray has_dimension implementation 2017-05-01 12:15:26 +02:00
Jakub Zelenka 9622a3be43 Merge branch 'PHP-7.0' into PHP-7.1 2017-04-30 20:27:39 +01:00
Michael Heimpold d9dfac90bf Fix compiler warnings when compiled against musl libc
musl libc is complaining when <sys/poll.h> is used instead of <poll.h>
so change this.

This issue was reported for OpenWrt/LEDE where musl libc is the standard
C library instead of e.g. glibc, see the following link for the original PR:
https://github.com/openwrt/packages/pull/4263

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Signed-off-by: Michael Heimpold <mhei@heimpold.de>

--

v3: refined checks/fallback paths as suggested by @bukka

v2: rebased to resolve merge conflict in main/php_network.h

v1: initial PR
2017-04-30 20:24:56 +01:00
Jakub Zelenka 6028fe511e Fix bug #73808 (iv length warning too restrictive for aes-128-ccm) 2017-04-30 19:46:27 +01:00
Andrea Faulds 9891b9ede2 Test ReflectionType support of iterable 2017-04-29 16:12:46 +01:00
Jakub Zelenka c436fe2426 Merge branch 'PHP-7.0' into PHP-7.1 2017-04-27 15:45:31 +01:00
Jakub Zelenka a0b9554f94 Fix possible memory leak in openssl_encrypt and openssl_decrypt 2017-04-27 15:44:26 +01:00
Jakub Zelenka d83d5f4198 Merge branch 'PHP-7.0' into PHP-7.1 2017-04-27 15:11:52 +01:00
Jakub Zelenka 7b392c7154 Prefer using DIRECTORY_SEPARATOR in OpenSSL config path 2017-04-27 15:10:55 +01:00
Jakub Zelenka e7166ea9be Add oid_section to the testing openssl.cnf
It tests repeated OID addition
2017-04-27 15:09:58 +01:00
Anatol Belski 9a07e9e1f8 [ci skip] update NEWS 2017-04-27 11:43:13 +02:00
Anatol Belski 38a65d5ef9 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  [ci skip] update NEWS
2017-04-27 11:39:14 +02:00
Anatol Belski e67096dbbb [ci skip] update NEWS 2017-04-27 11:35:00 +02:00
Anatol Belski 392bcba58d Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Revert "Detect invalid port in xp_socket parse ip address"
  Revert "Follow up patch regarding bug #74216, see bug #74429"
2017-04-27 11:11:41 +02:00
Anatol Belski 09ef61e3ca Revert "Detect invalid port in xp_socket parse ip address"
This reverts commit bab0b99f37.
2017-04-27 02:49:12 +02:00
Anatol Belski bf3e2dce7b Revert "Follow up patch regarding bug #74216, see bug #74429"
This reverts commit cda7dcf4ca.
2017-04-27 02:49:01 +02:00
Anatol Belski 66dbeb81ba Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  sync bin sdk version
2017-04-26 17:05:56 +02:00
Anatol Belski 36301bd615 sync bin sdk version 2017-04-26 17:04:29 +02:00
Jakub Zelenka a1e74a9e0e Merge branch 'PHP-7.0' into PHP-7.1 2017-04-26 15:00:49 +01:00
Jakub Zelenka c0203c0ceb Do not add already added object to the internal OpenSSL table
This fixes OpenSSL 1.1 where adding object with OID that has been
already added causes an error - preventing of duplication.
2017-04-26 14:59:15 +01:00
Remi Collet 3f6d9fe9cc Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  rely on bundle config, instead of system one
2017-04-26 14:41:54 +02:00
Remi Collet f639b64dca rely on bundle config, instead of system one 2017-04-26 14:41:40 +02:00
Remi Collet 7962185ded Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  skip the test on OpenSSL < 1.1 for now
2017-04-26 14:39:14 +02:00
Anatol Belski 8cfaea656c skip the test on OpenSSL < 1.1 for now 2017-04-26 14:39:03 +02:00
Joe Watkins 91a0d48675 bump version after release 2017-04-25 16:49:20 +01:00
166 changed files with 10626 additions and 7780 deletions

No files matched your search

+2 -2
View File
@@ -24,7 +24,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.1
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.5
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
@@ -43,7 +43,7 @@ environment:
services:
# the setup scripts have to be touched, once some other db version is used
- mysql
- postgresql95
- postgresql96
platform:
- x64
+1 -1
View File
@@ -57,4 +57,4 @@ before_script:
# Run PHPs run-tests.php
script:
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 1 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --set-timeout 120
+118
View File
@@ -1,5 +1,114 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
06 Jul 2017, PHP 7.1.7
- Core:
. Fixed bug #74738 (Multiple [PATH=] and [HOST=] sections not properly
parsed). (Manuel Mausz)
. Fixed bug #74658 (Undefined constants in array properties result in broken
properties). (Laruence)
. Fixed misparsing of abstract unix domain socket names. (Sara)
. Fixed bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability).
(Stas)
. Fixed bug #74101, bug #74614 (Unserialize Heap Use-After-Free (READ: 1) in
zval_get_type). (Nikita)
. Fixed bug #74111 (Heap buffer overread (READ: 1) finish_nested_data from
unserialize). (Nikita)
. Fixed bug #74819 (wddx_deserialize() heap out-of-bound read via
php_parse_date()). (Derick)
- Date:
. Fixed bug #74639 (implement clone for DatePeriod and DateInterval).
(andrewnester)
- DOM:
. Fixed bug #69373 (References to deleted XPath query results). (ttoohey)
- GD:
. Fixed bug #74435 (Buffer over-read into uninitialized memory). (cmb)
- Intl:
. Fixed bug #73473 (Stack Buffer Overflow in msgfmt_parse_message). (libnex)
. Fixed bug #74705 (Wrong reflection on Collator::getSortKey and
collator_get_sort_key). (Tyson Andre, Remi)
- Mbstring:
. Add oniguruma upstream fix (CVE-2017-9224, CVE-2017-9226, CVE-2017-9227,
CVE-2017-9228, CVE-2017-9229) (Remi, Mamoru TASAKA)
- OCI8:
. Add TAF callback (PR #2459). (KoenigsKind)
- Opcache:
. Fixed bug #74663 (Segfault with opcache.memory_protect and
validate_timestamp). (Laruence)
. Revert opcache.enable_cli to default disabled. (Nikita)
- OpenSSL:
. Fixed bug #74720 (pkcs7_en/decrypt does not work if \x1a is used in
content). (Anatol)
. Fixed bug #74651 (negative-size-param (-1) in memcpy in zif_openssl_seal()).
(Stas)
- PDO_OCI:
. Support Instant Client 12.2 in --with-pdo-oci configure option.
(Tianfang Yang)
- Reflection:
. Fixed bug #74673 (Segfault when cast Reflection object to string with
undefined constant). (Laruence)
- SPL:
. Fixed bug #74478 (null coalescing operator failing with SplFixedArray).
(jhdxr)
- FTP:
. Fixed bug #74598 (ftp:// wrapper ignores context arg). (Sara)
- PHAR:
. Fixed bug #74386 (Phar::__construct reflection incorrect). (villfa)
- SOAP
. Fixed bug #74679 (Incorrect conversion array with WSDL_CACHE_MEMORY).
(Dmitry)
- Streams:
. Fixed bug #74556 (stream_socket_get_name() returns '\0'). (Sara)
8 Jun 2017, PHP 7.1.6
- Core:
. Fixed bug #74600 (crash (SIGSEGV) in _zend_hash_add_or_update_i).
(Laruence)
. Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST).
(Laruence)
. Fixed bug #74589 (__DIR__ wrong for unicode character). (Anatol)
- intl:
. Fixed bug #74468 (wrong reflection on Collator::sortWithSortKeys). (villfa)
- MySQLi:
. Fixed bug #74547 (mysqli::change_user() doesn't accept null as $database
argument w/strict_types). (Anatol)
- Opcache:
. Fixed bug #74596 (SIGSEGV with opcache.revalidate_path enabled). (Laruence)
- phar:
. Fixed bug #51918 (Phar::webPhar() does not handle requests sent through PUT
and DELETE method). (Christian Weiske)
- Readline:
. Fixed bug #74490 (readline() moves the cursor to the beginning of the line).
(Anatol)
- Standard:
. Fixed bug #74510 (win32/sendmail.c anchors CC header but not BCC).
(Damian Wadley, Anatol)
- xmlreader:
. Fixed bug #74457 (Wrong reflection on XMLReader::expand). (villfa)
11 May 2017, PHP 7.1.5
- Core:
@@ -15,6 +124,7 @@ PHP NEWS
(Matt Ficken)
. Fixed bug #74337 (php-cgi.exe crash on facebook callback).
(Anton Serbulov)
. Patch for bug #74216 was reverted. (Anatol)
- Date:
. Fixed bug #74404 (Wrong reflection on DateTimeZone::getTransitions).
@@ -33,6 +143,10 @@ PHP NEWS
. Fixed bug #74343 (compile fails on solaris 11 with system gd2 library).
(krakjoe)
- MySQLi:
. Fixed bug #74432 (mysqli_connect adding ":3306" to $host if $port parameter
not given). (Anatol)
- MySQLnd:
. Fixed bug #74376 (Invalid free of persistent results on error/connection
loss). (Yussuf Khalil)
@@ -57,6 +171,8 @@ PHP NEWS
key). (Jakub Zelenka)
. Fixed bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without
seconds). (Moritz Fain)
. Fixed bug #73808 (iv length warning too restrictive for aes-128-ccm).
(Jakub Zelenka)
- phar:
. Fixed bug #74383 (phar method parameters reflection correction).
@@ -198,6 +314,8 @@ PHP NEWS
anonymous classes). (Adam Saponara)
. Fixed bug #74105 (PHP on Linux should use /dev/urandom when getrandom is
not available). (Benjamin Robin)
. Fixed bug #74708 (Invalid Reflection signatures for random_bytes and
random_int). (Tyson Andre, Remi)
- Streams:
. Fixed bug #73496 (Invalid memory access in zend_inline_hash_func).
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
--FILE--
<?php
"000000"[0]::d;
?>
--EXPECTF--
Fatal error: Uncaught Error: Class '0' not found in %sbug74546.php:%d
Stack trace:
#0 {main}
thrown in %sbug74546.php on line %d
+1
View File
@@ -0,0 +1 @@
0=0&~2000000000
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #74603 (PHP INI Parsing Stack Buffer Overflow Vulnerability)
--SKIPIF--
<?php
if (PHP_INT_MAX !== 2147483647)
die('skip for 32-bit only');
--FILE--
<?php
var_dump(parse_ini_file(__DIR__ . "/bug74603.ini", true, INI_SCANNER_NORMAL));
?>
--EXPECT--
array(1) {
[0]=>
string(1) "0"
}
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #74657 (Undefined constants in array properties result in broken properties)
--FILE--
<?php
interface I {
}
class C {
const FOO = I::FOO;
public $options = [self::FOO => "bar"];
}
try {
var_dump((new C)->options);
} catch (Throwable $e) {}
var_dump((new C)->options);
?>
--EXPECTF--
Fatal error: Uncaught Error: Undefined class constant 'I::FOO' in %sbug74657.php:%d
Stack trace:
#0 {main}
thrown in %sbug74657.php on line %d
+29
View File
@@ -0,0 +1,29 @@
--TEST--
Bug #74606 (Segfault within try/catch/finally nesting in Generators)
--FILE--
<?php
function gen() {
$array = ["foo"];
$array[] = "bar";
foreach ($array as $item) {
try {
try {
yield;
} finally {
echo "fin $item\n";
}
} catch (\Exception $e) {
echo "catch\n";
continue;
}
}
}
gen()->throw(new Exception);
?>
--EXPECT--
fin foo
catch
fin bar
+2 -2
View File
@@ -1088,8 +1088,6 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable *properties) /* {{{ */
ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
{
if (!(class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) {
class_type->ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
if (class_type->parent) {
if (UNEXPECTED(zend_update_class_constants(class_type->parent) != SUCCESS)) {
return FAILURE;
@@ -1158,7 +1156,9 @@ ZEND_API int zend_update_class_constants(zend_class_entry *class_type) /* {{{ */
ce = ce->parent;
}
}
class_type->ce_flags |= ZEND_ACC_CONSTANTS_UPDATED;
}
return SUCCESS;
}
/* }}} */
+14 -4
View File
@@ -6455,7 +6455,11 @@ static zend_bool zend_try_ct_eval_magic_const(zval *zv, zend_ast *ast) /* {{{ */
{
zend_string *filename = CG(compiled_filename);
zend_string *dirname = zend_string_init(ZSTR_VAL(filename), ZSTR_LEN(filename), 0);
#ifdef ZEND_WIN32
php_win32_ioutil_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
#else
zend_dirname(ZSTR_VAL(dirname), ZSTR_LEN(dirname));
#endif
if (strcmp(ZSTR_VAL(dirname), ".") == 0) {
dirname = zend_string_extend(dirname, MAXPATHLEN, 0);
@@ -7370,8 +7374,11 @@ void zend_compile_class_const(znode *result, zend_ast *ast) /* {{{ */
return;
}
zend_eval_const_expr(&class_ast);
zend_eval_const_expr(&const_ast);
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
class_ast = ast->child[0];
const_ast = ast->child[1];
if (class_ast->kind == ZEND_AST_ZVAL) {
zend_string *resolved_name;
@@ -8309,8 +8316,11 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
break;
}
zend_eval_const_expr(&class_ast);
zend_eval_const_expr(&name_ast);
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
class_ast = ast->child[0];
name_ast = ast->child[1];
if (name_ast->kind == ZEND_AST_ZVAL && zend_string_equals_literal_ci(zend_ast_get_str(name_ast), "class")) {
zend_error_noreturn(E_COMPILE_ERROR,
+1 -1
View File
@@ -108,7 +108,7 @@ static void zend_generator_cleanup_unfinished_execution(
if (UNEXPECTED(generator->frozen_call_stack)) {
zend_generator_restore_call_stack(generator);
}
zend_cleanup_unfinished_execution(execute_data, op_num, 0);
zend_cleanup_unfinished_execution(execute_data, op_num, catch_op_num);
}
}
/* }}} */
+1 -1
View File
@@ -55,7 +55,7 @@ static void zend_ini_do_op(char type, zval *result, zval *op1, zval *op2)
int i_result;
int i_op1, i_op2;
int str_len;
char str_result[MAX_LENGTH_OF_LONG];
char str_result[MAX_LENGTH_OF_LONG+1];
i_op1 = atoi(Z_STRVAL_P(op1));
zend_string_free(Z_STR_P(op1));
+4 -1
View File
@@ -29,5 +29,8 @@ if not exist "%SDK_RUNNER%" (
exit /b 3
)
call %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat
cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\build_task.bat
if %errorlevel% neq 0 exit /b 3
exit /b 0
+3 -3
View File
@@ -19,10 +19,10 @@ set STABILITY=staging
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
rem SDK is cached, deps info is cached as well
echo Updating dependencies in %DEPS_DIR%
call phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
if %errorlevel% neq 0 exit /b 3
call buildconf.bat --force
cmd /c buildconf.bat --force
if %errorlevel% neq 0 exit /b 3
if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts
@@ -30,7 +30,7 @@ if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts
set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,dba
if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
call configure.bat ^
cmd /c configure.bat ^
--enable-snapshot-build ^
--disable-debug-pack ^
--with-mcrypt=shared ^
+4 -1
View File
@@ -6,5 +6,8 @@ if not exist "%SDK_RUNNER%" (
exit /b 3
)
call %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\test_task.bat
cmd /c %SDK_RUNNER% -t %APPVEYOR_BUILD_FOLDER%\appveyor\test_task.bat
if %errorlevel% neq 0 exit /b 3
exit /b 0
+14
View File
@@ -12,6 +12,10 @@ if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
set STABILITY=staging
)
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
if not exist "%DEPS_DIR%" (
echo "%DEPS_DIR%" doesn't exist
exit /b 3
)
rem setup MySQL related exts
set MYSQL_PWD=Password12!
@@ -25,6 +29,7 @@ set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST%
set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT%
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST% port=%PDO_MYSQL_TEST_PORT% dbname=test user=%PDO_MYSQL_TEST_USER% password=%MYSQL_PW%
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test"
if %errorlevel% neq 0 exit /b 3
rem setup PostgreSQL related exts
set PGUSER=postgres
@@ -33,12 +38,15 @@ rem set PGSQL_TEST_CONNSTR=host=127.0.0.1 dbname=test port=5432 user=postgres pa
echo ^<?php $conn_str = "host=127.0.0.1 dbname=test port=5432 user=%PGUSER% password=%PGPASSWORD%"; ?^> >> "./ext/pgsql/tests/config.inc"
set PDO_PGSQL_TEST_DSN=pgsql:host=127.0.0.1 port=5432 dbname=test user=%PGUSER% password=%PGPASSWORD%
"C:\Program Files\PostgreSQL\9.5\bin\createdb.exe" test
if %errorlevel% neq 0 exit /b 3
rem prepare for ext/openssl
if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win32 >NUL 2>NUL
if "%APPVEYOR%" equ "True" rmdir /s /q C:\OpenSSL-Win64 >NUL 2>NUL
mkdir c:\usr\local\ssl
if %errorlevel% neq 0 exit /b 3
copy %DEPS_DIR%\template\ssl\openssl.cnf c:\usr\local\ssl
if %errorlevel% neq 0 exit /b 3
set OPENSSL_CONF=c:\usr\local\ssl\openssl.cnf
rem set OPENSSL_CONF=
rem set SSLEAY_CONF=
@@ -48,9 +56,13 @@ if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enabled=1 -d opcache.enable_c
rem prepare for enchant
mkdir c:\enchant_plugins
if %errorlevel% neq 0 exit /b 3
copy %DEPS_DIR%\bin\libenchant_ispell.dll c:\enchant_plugins
if %errorlevel% neq 0 exit /b 3
copy %DEPS_DIR%\bin\libenchant_myspell.dll c:\enchant_plugins
if %errorlevel% neq 0 exit /b 3
reg add HKEY_CURRENT_USER\SOFTWARE\Enchant\Config /v Module_Dir /t REG_SZ /d c:\enchant_plugins
if %errorlevel% neq 0 exit /b 3
set PHP_BUILD_CACHE_ENCHANT_DICT_DIR=%PHP_BUILD_CACHE_BASE_DIR%\enchant_dict
if not exist "%PHP_BUILD_CACHE_ENCHANT_DICT_DIR%" (
echo Creating %PHP_BUILD_CACHE_ENCHANT_DICT_DIR%
@@ -73,3 +85,5 @@ mkdir c:\tests_tmp
cd "%APPVEYOR_BUILD_FOLDER%"
nmake test TESTS="%OPCACHE_OPTS% -q --offline --show-diff --set-timeout 120 -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP --temp-source c:\tests_tmp --temp-target c:\tests_tmp"
exit /b %errorlevel%
+2 -1
View File
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=1
PHP_RELEASE_VERSION=5
PHP_RELEASE_VERSION=7
PHP_EXTRA_VERSION=""
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`
@@ -494,6 +494,7 @@ limits.h \
locale.h \
monetary.h \
netdb.h \
poll.h \
pwd.h \
resolv.h \
signal.h \
+7485 -6852
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -913,7 +913,7 @@ datefull = day ([ \t.-])* monthtext ([ \t.-])* year;
datenoday = monthtext ([ .\t-])* year4;
datenodayrev = year4 ([ .\t-])* monthtext;
datetextual = monthtext ([ .\t-])* day [,.stndrh\t ]+ year;
datenoyear = monthtext ([ .\t-])* day [,.stndrh\t ]*;
datenoyear = monthtext ([ .\t-])* day ([,.stndrh\t ]+|[\000]);
datenoyearrev = day ([ .\t-])* monthtext;
datenocolon = year4 monthlz daylz;
+20 -2
View File
@@ -2397,8 +2397,11 @@ static zend_object *date_object_clone_interval(zval *this_ptr) /* {{{ */
php_interval_obj *new_obj = php_interval_obj_from_obj(date_object_new_interval_ex(old_obj->std.ce, 0));
zend_objects_clone_members(&new_obj->std, &old_obj->std);
new_obj->initialized = old_obj->initialized;
if (old_obj->diff) {
new_obj->diff = timelib_rel_time_clone(old_obj->diff);
}
/** FIX ME ADD CLONE STUFF **/
return &new_obj->std;
} /* }}} */
@@ -2481,8 +2484,23 @@ static zend_object *date_object_clone_period(zval *this_ptr) /* {{{ */
php_period_obj *new_obj = php_period_obj_from_obj(date_object_new_period_ex(old_obj->std.ce, 0));
zend_objects_clone_members(&new_obj->std, &old_obj->std);
new_obj->initialized = old_obj->initialized;
new_obj->recurrences = old_obj->recurrences;
new_obj->include_start_date = old_obj->include_start_date;
new_obj->start_ce = old_obj->start_ce;
/** FIX ME ADD CLONE STUFF **/
if (old_obj->start) {
new_obj->start = timelib_time_clone(old_obj->start);
}
if (old_obj->current) {
new_obj->current = timelib_time_clone(old_obj->current);
}
if (old_obj->end) {
new_obj->end = timelib_time_clone(old_obj->end);
}
if (old_obj->interval) {
new_obj->interval = timelib_rel_time_clone(old_obj->interval);
}
return &new_obj->std;
} /* }}} */
+1 -1
View File
@@ -12,7 +12,7 @@ for ( $i = 0; $i < 1000; $i++ )
}
var_dump($n = count( $collect ));
echo ( $n > 800 ) ? "microseconds differ\n" : "microseconds do not differ enough ($n)\n";
echo ( $n > 700 ) ? "microseconds differ\n" : "microseconds do not differ enough ($n)\n";
?>
--EXPECTF--
int(%d)
+33
View File
@@ -0,0 +1,33 @@
--TEST--
Bug #74639 Cloning DatePeriod leads to segfault
--FILE--
<?php
$start = new DateTime('2017-05-22 09:00:00');
$end = new DateTime('2017-08-24 18:00:00');
$interval = $start->diff($end);
$period = new DatePeriod($start, $interval, $end);
$clonedPeriod = clone $period;
$clonedInterval = clone $interval;
if ($period->getStartDate() != $clonedPeriod->getStartDate()) {
echo "failure\n";
}
if ($period->getEndDate() != $clonedPeriod->getEndDate()) {
echo "failure\n";
}
if ($period->getDateInterval() != $clonedPeriod->getDateInterval()) {
echo "failure\n";
}
if ($interval->format('Y-m-d H:i:s') != $clonedInterval->format('Y-m-d H:i:s')) {
echo "failure\n";
}
echo 'success';
?>
--EXPECT--
success
+30
View File
@@ -0,0 +1,30 @@
--TEST--
Test for bug #74652: Incomplete dates
--INI--
date.timezone=UTC
--FILE--
<?php
$formats = [
'2017-03-25 10:52:09',
'2017-03-25 10:52',
'2017-03-25 10am',
'2017-03-25',
'2017-03',
'2017.042',
'2017043',
];
foreach ( $formats as $format )
{
$dt = new DateTimeImmutable( $format );
echo $dt->format( 'Y-m-d H:i:s' ), "\n";
}
?>
--EXPECT--
2017-03-25 10:52:09
2017-03-25 10:52:00
2017-03-25 10:00:00
2017-03-25 00:00:00
2017-03-01 00:00:00
2017-02-11 00:00:00
2017-02-12 00:00:00
+10
View File
@@ -337,6 +337,8 @@ int dom_node_node_value_write(dom_object *obj, zval *newval)
case XML_ATTRIBUTE_NODE:
if (nodep->children) {
node_list_unlink(nodep->children);
php_libxml_node_free_list((xmlNodePtr) nodep->children);
nodep->children = NULL;
}
case XML_TEXT_NODE:
case XML_COMMENT_NODE:
@@ -854,6 +856,14 @@ int dom_node_text_content_write(dom_object *obj, zval *newval)
return FAILURE;
}
if (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE) {
if (nodep->children) {
node_list_unlink(nodep->children);
php_libxml_node_free_list((xmlNodePtr) nodep->children);
nodep->children = NULL;
}
}
str = zval_get_string(newval);
/* we have to use xmlNodeAddContent() to get the same behavior as with xmlNewText() */
xmlNodeSetContent(nodep, (xmlChar *) "");
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #69373 References to deleted XPath query results
--FILE--
<?php
$doc = new DOMDocument();
for( $i=0; $i<20; $i++ ) {
$doc->loadXML("<parent><child /><child /></parent>");
$xpath = new DOMXpath($doc);
$all = $xpath->query('//*');
$doc->firstChild->nodeValue = '';
}
echo 'DONE', PHP_EOL;
?>
--EXPECT--
DONE
+3
View File
@@ -147,6 +147,9 @@ gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
int haveGlobalColormap;
gdImagePtr im = 0;
memset(ColorMap, 0, 3 * MAXCOLORMAPSIZE);
memset(localColorMap, 0, 3 * MAXCOLORMAPSIZE);
/*1.4//imageNumber = 1; */
if (! ReadOK(fd,buf,6)) {
return 0;
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #74435 (Buffer over-read into uninitialized memory)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$im = imagecreatefromgif(__DIR__ . DIRECTORY_SEPARATOR . 'bug74435.gif');
var_dump($im);
$width = imagesx($im);
$height = imagesy($im);
for ($i = 0; $i < $width; $i += 16) {
for ($j = 0; $j < $height; $j += 16) {
if (($index = imagecolorat($im, $i, $j)) >= 2) {
list($red, $green, $blue, $alpha) = array_values(imagecolorsforindex($im, $index));
if ($red !== 0 || $green !== 0 || $blue !== 0 || $alpha !== 0) {
echo "unexpected color at ($i, $j)\n";
}
}
}
}
?>
===DONE===
--EXPECTF--
resource(%d) of type (gd)
===DONE===
+6 -2
View File
@@ -88,6 +88,10 @@ ZEND_BEGIN_ARG_INFO_EX( collator_sort_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, flags )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( collator_sort_with_sort_keys_args, 0, 0, 1 )
ZEND_ARG_ARRAY_INFO( 1, arr, 0 )
ZEND_END_ARG_INFO()
/* }}} */
/* {{{ Collator_class_functions
@@ -99,7 +103,7 @@ zend_function_entry Collator_class_functions[] = {
ZEND_FENTRY( create, ZEND_FN( collator_create ), collator_1_arg, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
PHP_NAMED_FE( compare, ZEND_FN( collator_compare ), collator_2_args )
PHP_NAMED_FE( sort, ZEND_FN( collator_sort ), collator_sort_args )
PHP_NAMED_FE( sortWithSortKeys, ZEND_FN( collator_sort_with_sort_keys ), collator_sort_args )
PHP_NAMED_FE( sortWithSortKeys, ZEND_FN( collator_sort_with_sort_keys ), collator_sort_with_sort_keys_args )
PHP_NAMED_FE( asort, ZEND_FN( collator_asort ), collator_sort_args )
PHP_NAMED_FE( getAttribute, ZEND_FN( collator_get_attribute ), collator_1_arg )
PHP_NAMED_FE( setAttribute, ZEND_FN( collator_set_attribute ), collator_2_args )
@@ -108,7 +112,7 @@ zend_function_entry Collator_class_functions[] = {
PHP_NAMED_FE( getLocale, ZEND_FN( collator_get_locale ), collator_1_arg )
PHP_NAMED_FE( getErrorCode, ZEND_FN( collator_get_error_code ), collator_0_args )
PHP_NAMED_FE( getErrorMessage, ZEND_FN( collator_get_error_message ), collator_0_args )
PHP_NAMED_FE( getSortKey, ZEND_FN( collator_get_sort_key ), collator_2_args )
PHP_NAMED_FE( getSortKey, ZEND_FN( collator_get_sort_key ), collator_1_arg )
PHP_FE_END
};
/* }}} */
+1
View File
@@ -110,6 +110,7 @@ PHP_FUNCTION( msgfmt_parse_message )
RETURN_FALSE;
}
INTL_CHECK_LOCALE_LEN(slocale_len);
memset(mfo, 0, sizeof(*mfo));
msgformat_data_init(&mfo->mf_data);
+7 -2
View File
@@ -154,6 +154,11 @@ ZEND_BEGIN_ARG_INFO_EX(collator_sort_args, 0, 0, 2)
ZEND_ARG_INFO(0, sort_flags)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(collator_sort_with_sort_keys_args, 0, 0, 2)
ZEND_ARG_OBJ_INFO(0, coll, Collator, 0)
ZEND_ARG_ARRAY_INFO(1, arr, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(numfmt_parse_arginfo, 0, 0, 2)
ZEND_ARG_INFO(0, formatter)
ZEND_ARG_INFO(0, string)
@@ -629,12 +634,12 @@ zend_function_entry intl_functions[] = {
PHP_FE( collator_get_strength, collator_0_args )
PHP_FE( collator_set_strength, collator_1_arg )
PHP_FE( collator_sort, collator_sort_args )
PHP_FE( collator_sort_with_sort_keys, collator_sort_args )
PHP_FE( collator_sort_with_sort_keys, collator_sort_with_sort_keys_args )
PHP_FE( collator_asort, collator_sort_args )
PHP_FE( collator_get_locale, collator_1_arg )
PHP_FE( collator_get_error_code, collator_0_args )
PHP_FE( collator_get_error_message, collator_0_args )
PHP_FE( collator_get_sort_key, collator_2_args )
PHP_FE( collator_get_sort_key, collator_1_arg )
/* formatter functions */
PHP_FE( numfmt_create, arginfo_numfmt_create )
+2 -2
View File
@@ -13,7 +13,7 @@ var_dump((new \IntlDateFormatter(
'UTC',
\IntlDateFormatter::GREGORIAN,
'yyyy-MM-dd HH:mm:ss.SSSSSS'
))->format(new \DateTime('2017-01-01 01:02:03.123456')));
))->format(new \DateTime('2017-01-01 01:02:03.123456', new \DateTimeZone('UTC'))));
var_dump(datefmt_create(
'en-US',
@@ -22,7 +22,7 @@ var_dump(datefmt_create(
'UTC',
\IntlDateFormatter::GREGORIAN,
'yyyy-MM-dd HH:mm:ss.SSSSSS'
)->format(new \DateTime('2017-01-01 01:02:03.123456')));
)->format(new \DateTime('2017-01-01 01:02:03.123456', new \DateTimeZone('UTC'))));
?>
--EXPECTF--
string(26) "2017-01-01T01:02:03.123456"
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #74468 Wrong reflection on Collator::sortWithSortKeys
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '51.2') >= 0) die('skip for ICU < 51.2'); ?>
--FILE--
<?php
$rm = new ReflectionMethod(Collator::class, 'sortWithSortKeys');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
$rf = new ReflectionFunction('collator_sort_with_sort_keys');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(1)
int(1)
int(2)
int(2)
===DONE===
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #74705 Wrong reflection on Collator::getSortKey
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
--FILE--
<?php
$rm = new ReflectionMethod(Collator::class, 'getSortKey');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
$rf = new ReflectionFunction('collator_get_sort_key');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(1)
int(1)
int(2)
int(2)
===DONE===
@@ -19,8 +19,8 @@ var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG, 'pt_PT'));
?>
==DONE==
--EXPECT--
--EXPECTF--
string(30) "Western European Standard Time"
string(30) "Western European Standard Time"
string(32) "Hora Padrão da Europa Ocidental"
string(32) "Hora %cadrão da Europa Ocidental"
==DONE==
+1 -1
View File
@@ -8,7 +8,7 @@ data-interchange format as specified in RFC 7159
The parser is implemented using re2c and Bison. The used versions
of both tools for generating files in the repository are following:
re2c 0.14.3
re2c 0.16
Bison 3.0.4
It is recommended to do all contributions to the JSON extension
+644 -713
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -1,4 +1,4 @@
/* Generated by re2c 0.13.5 */
/* Generated by re2c 0.16 */
enum YYCONDTYPE {
yycJS,
+2 -2
View File
@@ -415,7 +415,7 @@ PHP_FUNCTION(ldap_connect)
{
int rc = LDAP_SUCCESS;
char *url = host;
if (!ldap_is_ldap_url(url)) {
if (url && !ldap_is_ldap_url(url)) {
int urllen = hostlen + sizeof( "ldap://:65535" );
if (port <= 0 || port > 65535) {
@@ -425,7 +425,7 @@ PHP_FUNCTION(ldap_connect)
}
url = emalloc(urllen);
snprintf( url, urllen, "ldap://%s:" ZEND_LONG_FMT, host ? host : "", port );
snprintf( url, urllen, "ldap://%s:" ZEND_LONG_FMT, host, port );
}
#ifdef LDAP_API_FEATURE_X_OPENLDAP
@@ -0,0 +1,26 @@
--TEST--
ldap_connect() - Connection using default host from openldap's ldap.conf
--CREDITS--
David Caldwell <david@galvanix.com>
--SKIPIF--
<?php
require_once('skipif.inc');
ob_start();
phpinfo();
if (!preg_match("/vendor name => openldap/i", ob_get_clean()))
die("skip not openldap");
?>
--FILE--
<?php
$conf=tempnam("/tmp","ldap.conf");
file_put_contents($conf, "uri ldaps://example.com:3141/");
putenv("LDAPCONF=$conf");
$link = ldap_connect();
ldap_get_option($link, LDAP_OPT_HOST_NAME, $host);
var_dump($host);
unlink($conf);
?>
===DONE===
--EXPECTF--
string(16) "example.com:3141"
===DONE===
+1 -1
View File
@@ -224,7 +224,7 @@ static void php_libxml_node_free(xmlNodePtr node)
}
}
static void php_libxml_node_free_list(xmlNodePtr node)
PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node)
{
xmlNodePtr curnode;
+1
View File
@@ -100,6 +100,7 @@ PHP_LIBXML_API int php_libxml_decrement_doc_ref(php_libxml_node_object *object);
PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object);
PHP_LIBXML_API zval *php_libxml_register_export(zend_class_entry *ce, php_libxml_export_node export_function);
/* When an explicit freeing of node and children is required */
PHP_LIBXML_API void php_libxml_node_free_list(xmlNodePtr node);
PHP_LIBXML_API void php_libxml_node_free_resource(xmlNodePtr node);
/* When object dtor is called as node may still be referenced */
PHP_LIBXML_API void php_libxml_node_decrement_resource(php_libxml_node_object *object);
+10 -6
View File
@@ -1425,14 +1425,9 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
break;
case OP_EXACT1: MOP_IN(OP_EXACT1);
#if 0
DATA_ENSURE(1);
if (*p != *s) goto fail;
p++; s++;
#endif
if (*p != *s++) goto fail;
DATA_ENSURE(0);
p++;
MOP_OUT;
break;
@@ -3128,6 +3123,8 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
}
else {
UChar *q = p + reg->dmin;
if (q >= end) return 0; /* fail */
while (p < q) p += enclen(reg->enc, p);
}
}
@@ -3208,7 +3205,13 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
else {
if (reg->dmax != ONIG_INFINITE_DISTANCE) {
*low = p - reg->dmax;
if (*low > s) {
if (p - str < reg->dmax) {
*low = (UChar* )str;
if (low_prev)
*low_prev = onigenc_get_prev_char_head(reg->enc, str, *low);
}
else {
if (*low > s) {
*low = onigenc_get_right_adjust_char_head_with_prev(reg->enc, s,
*low, (const UChar** )low_prev);
if (low_prev && IS_NULL(*low_prev))
@@ -3221,6 +3224,7 @@ forward_search_range(regex_t* reg, const UChar* str, const UChar* end, UChar* s,
(pprev ? pprev : str), *low);
}
}
}
}
/* no needs to adjust *high, *high is used as range check only */
*high = p - reg->dmin;
+9 -3
View File
@@ -3064,7 +3064,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
PUNFETCH;
prev = p;
num = scan_unsigned_octal_number(&p, end, 3, enc);
if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
if (p == prev) { /* can't read nothing. */
num = 0; /* but, it's not error */
}
@@ -3436,7 +3436,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
if (IS_SYNTAX_OP(syn, ONIG_SYN_OP_ESC_OCTAL3)) {
prev = p;
num = scan_unsigned_octal_number(&p, end, (c == '0' ? 2:3), enc);
if (num < 0) return ONIGERR_TOO_BIG_NUMBER;
if (num < 0 || num >= 256) return ONIGERR_TOO_BIG_NUMBER;
if (p == prev) { /* can't read nothing. */
num = 0; /* but, it's not error */
}
@@ -4068,7 +4068,9 @@ next_state_class(CClassNode* cc, OnigCodePoint* vs, enum CCVALTYPE* type,
}
}
*state = CCS_VALUE;
if (*state != CCS_START)
*state = CCS_VALUE;
*type = CCV_CLASS;
return 0;
}
@@ -4084,7 +4086,11 @@ next_state_val(CClassNode* cc, OnigCodePoint *vs, OnigCodePoint v,
switch (*state) {
case CCS_VALUE:
if (*type == CCV_SB)
{
if (*vs > 0xff)
return ONIGERR_INVALID_CODE_POINT_VALUE;
BITSET_SET_BIT(cc->bs, (int )(*vs));
}
else if (*type == CCV_CODE_POINT) {
r = add_code_range(&(cc->mbuf), env, *vs, *vs);
if (r < 0) return r;
+1 -1
View File
@@ -619,7 +619,7 @@ PHP_FUNCTION(mysqli_change_user)
const CHARSET_INFO * old_charset;
#endif
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Osss!", &mysql_link, mysqli_link_class_entry, &user, &user_len, &password, &password_len, &dbname, &dbname_len) == FAILURE) {
return;
}
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
+30 -6
View File
@@ -261,6 +261,17 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_query, 0, 0, 2)
MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
ZEND_ARG_INFO(0, query)
ZEND_ARG_INFO(0, resultmode)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_multi_query, 0, 0, 1)
MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
ZEND_ARG_INFO(0, query)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_real_query, 0, 0, 1)
MYSQLI_ZEND_ARG_OBJ_INFO_LINK()
ZEND_ARG_INFO(0, query)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_prepare, 0, 0, 2)
@@ -275,6 +286,19 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_query, 0, 0, 1)
ZEND_ARG_INFO(0, query)
ZEND_ARG_INFO(0, resultmode)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_prepare, 0, 0, 1)
ZEND_ARG_INFO(0, query)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_multi_query, 0, 0, 1)
ZEND_ARG_INFO(0, query)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_mysqli_real_query, 0, 0, 1)
ZEND_ARG_INFO(0, query)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_mysqli_options, 0, 0, 3)
@@ -442,7 +466,7 @@ const zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_insert_id, arginfo_mysqli_only_link)
PHP_FE(mysqli_kill, arginfo_mysqli_kill)
PHP_FE(mysqli_more_results, arginfo_mysqli_only_link)
PHP_FE(mysqli_multi_query, arginfo_mysqli_query)
PHP_FE(mysqli_multi_query, arginfo_mysqli_multi_query)
PHP_FE(mysqli_next_result, arginfo_mysqli_only_link)
PHP_FE(mysqli_num_fields, arginfo_mysqli_only_result)
PHP_FE(mysqli_num_rows, arginfo_mysqli_only_result)
@@ -456,7 +480,7 @@ const zend_function_entry mysqli_functions[] = {
PHP_FE(mysqli_query, arginfo_mysqli_query)
PHP_FE(mysqli_real_connect, arginfo_mysqli_real_connect)
PHP_FE(mysqli_real_escape_string, arginfo_mysqli_real_escape_string)
PHP_FE(mysqli_real_query, arginfo_mysqli_query)
PHP_FE(mysqli_real_query, arginfo_mysqli_real_query)
#if defined(MYSQLI_USE_MYSQLND)
PHP_FE(mysqli_reap_async_query, arginfo_mysqli_only_link)
#endif
@@ -542,7 +566,7 @@ const zend_function_entry mysqli_link_methods[] = {
PHP_FALIAS(get_warnings, mysqli_get_warnings, arginfo_mysqli_no_params)
PHP_FALIAS(init,mysqli_init_method, arginfo_mysqli_no_params)
PHP_FALIAS(kill,mysqli_kill, arginfo_class_mysqli_kill)
PHP_FALIAS(multi_query, mysqli_multi_query, arginfo_class_mysqli_query)
PHP_FALIAS(multi_query, mysqli_multi_query, arginfo_class_mysqli_multi_query)
PHP_FALIAS(__construct, mysqli_link_construct, arginfo_mysqli_connect)
PHP_FALIAS(more_results, mysqli_more_results, arginfo_mysqli_no_params)
PHP_FALIAS(next_result, mysqli_next_result, arginfo_mysqli_no_params)
@@ -551,7 +575,7 @@ const zend_function_entry mysqli_link_methods[] = {
#if defined(MYSQLI_USE_MYSQLND)
ZEND_FENTRY(poll, ZEND_FN(mysqli_poll), arginfo_mysqli_poll, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC)
#endif
PHP_FALIAS(prepare, mysqli_prepare, arginfo_class_mysqli_query)
PHP_FALIAS(prepare, mysqli_prepare, arginfo_class_mysqli_prepare)
PHP_FALIAS(query, mysqli_query, arginfo_class_mysqli_query)
PHP_FALIAS(real_connect, mysqli_real_connect, arginfo_class_mysqli_real_connect)
PHP_FALIAS(real_escape_string, mysqli_real_escape_string, arginfo_class_mysqli_real_escape_string)
@@ -559,7 +583,7 @@ const zend_function_entry mysqli_link_methods[] = {
PHP_FALIAS(reap_async_query, mysqli_reap_async_query, arginfo_mysqli_no_params)
#endif
PHP_FALIAS(escape_string, mysqli_real_escape_string, arginfo_class_mysqli_real_escape_string)
PHP_FALIAS(real_query, mysqli_real_query, arginfo_class_mysqli_query)
PHP_FALIAS(real_query, mysqli_real_query, arginfo_class_mysqli_real_query)
PHP_FALIAS(release_savepoint, mysqli_release_savepoint, arginfo_class_mysqli_release_savepoint)
PHP_FALIAS(rollback, mysqli_rollback, arginfo_class_mysqli_rollback)
PHP_FALIAS(savepoint, mysqli_savepoint, arginfo_class_mysqli_savepoint)
@@ -628,7 +652,7 @@ const zend_function_entry mysqli_stmt_methods[] = {
PHP_FALIAS(send_long_data, mysqli_stmt_send_long_data, arginfo_class_mysqli_stmt_send_long_data)
PHP_FALIAS(free_result, mysqli_stmt_free_result, arginfo_mysqli_no_params)
PHP_FALIAS(reset, mysqli_stmt_reset, arginfo_mysqli_no_params)
PHP_FALIAS(prepare, mysqli_stmt_prepare, arginfo_class_mysqli_query)
PHP_FALIAS(prepare, mysqli_stmt_prepare, arginfo_class_mysqli_prepare)
PHP_FALIAS(store_result, mysqli_stmt_store_result, arginfo_mysqli_no_params)
#if defined(MYSQLI_USE_MYSQLND)
PHP_FALIAS(get_result, mysqli_stmt_get_result, arginfo_mysqli_no_params)
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #74547 mysqli::change_user() doesn't accept null as $database argument w/strict_types
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
declare(strict_types=1);
require_once("connect.inc");
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
var_dump(mysqli_change_user($link, $user, $passwd, NULL));
mysqli_close($link);
?>
===DONE===
--EXPECTF--
bool(true)
===DONE===
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #74595 (ReflectionMethod::getParameters returns incorrect number of parameters)
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
$class = new ReflectionClass('mysqli');
$method = $class->getMethod('query');
var_dump($method->getParameters());
?>
--EXPECTF--
array(2) {
[0]=>
object(ReflectionParameter)#%d (1) {
["name"]=>
string(5) "query"
}
[1]=>
object(ReflectionParameter)#%d (1) {
["name"]=>
string(10) "resultmode"
}
}
@@ -732,7 +732,7 @@ isInternal: yes
isUserDefined: no
returnsReference: no
Modifiers: 256
Number of Parameters: 1
Number of Parameters: 2
Number of Required Parameters: 1
Inspecting parameter 'query' of method 'query'
@@ -742,6 +742,13 @@ isPassedByReference: no
isOptional: no
isDefaultValueAvailable: no
Inspecting parameter 'resultmode' of method 'query'
isArray: no
allowsNull: no
isPassedByReference: no
isOptional: yes
isDefaultValueAvailable: no
Inspecting method 'real_connect'
isFinal: no
isAbstract: no
@@ -0,0 +1,29 @@
--TEST--
Bug #74432, BC issue on undocumented connect string
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifemb.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
/* This behavior is undocumented, but might be in use. Until there's no officially
supported alternative, ensure changes doesn't cause BC breach. Otherwise,
the test should be removed once the undocumented behavior changes. */
require_once("connect.inc");
$handle = mysqli_connect("$host:$port", $user, $passwd);
var_dump($handle);
if ($handle) {
mysqli_close($handle);
}
?>
--EXPECTF--
object(mysqli)#%d (%d) {
%A
}
+2 -2
View File
@@ -335,7 +335,7 @@ if test "$PHP_OCI8" != "no"; then
PHP_ADD_LIBRARY(clntsh, 1, OCI8_SHARED_LIBADD)
PHP_ADD_LIBPATH($OCI8_DIR/$OCI8_LIB_DIR, OCI8_SHARED_LIBADD)
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c, $ext_shared)
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c, $ext_shared)
AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle Database is configured])
PHP_SUBST_OLD(OCI8_SHARED_LIBADD)
@@ -406,7 +406,7 @@ if test "$PHP_OCI8" != "no"; then
AC_DEFINE(HAVE_OCI_INSTANT_CLIENT,1,[Defined to 1 if OCI8 configuration located Oracle's Instant Client libraries])
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c, $ext_shared)
PHP_NEW_EXTENSION(oci8, oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c, $ext_shared)
AC_DEFINE(HAVE_OCI8,1,[Defined to 1 if the PHP OCI8 extension for Oracle Database is configured])
PHP_SUBST_OLD(OCI8_SHARED_LIBADD)
+2 -2
View File
@@ -80,7 +80,7 @@ if (PHP_OCI8_11G != "no") {
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_11G", oci8_11g_inc_paths) &&
CHECK_LIB("oci.lib", "oci8_11g", oci8_11g_lib_paths))
{
EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_11g")
EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c', null, null, null, "ext\\oci8_11g")
AC_DEFINE('HAVE_OCI8', 1);
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
@@ -115,7 +115,7 @@ if (PHP_OCI8_12C != "no") {
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_12C", oci8_12c_inc_paths) &&
CHECK_LIB("oci.lib", "oci8_12c", oci8_12c_lib_paths))
{
EXTENSION('oci8_12c', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_12c")
EXTENSION('oci8_12c', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c oci8_failover.c', null, null, null, "ext\\oci8_12c")
AC_DEFINE('HAVE_OCI8', 1);
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
+38
View File
@@ -504,6 +504,11 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_collection, 0, 0, 2)
ZEND_ARG_INFO(0, type_name)
ZEND_ARG_INFO(0, schema_name)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_register_taf_callback, 0, 0, 1)
ZEND_ARG_INFO(0, connection_resource)
ZEND_ARG_INFO(0, function_name)
ZEND_END_ARG_INFO()
/* }}} */
/* {{{ LOB Method arginfo */
@@ -701,6 +706,7 @@ PHP_FUNCTION(oci_collection_assign);
PHP_FUNCTION(oci_collection_size);
PHP_FUNCTION(oci_collection_max);
PHP_FUNCTION(oci_collection_trim);
PHP_FUNCTION(oci_register_taf_callback);
/* }}} */
/* {{{ extension definition structures
@@ -783,6 +789,7 @@ static const zend_function_entry php_oci_functions[] = {
PHP_FE(oci_collection_max, arginfo_oci_collection_max)
PHP_FE(oci_collection_trim, arginfo_oci_collection_trim)
PHP_FE(oci_new_collection, arginfo_oci_new_collection)
PHP_FE(oci_register_taf_callback, arginfo_oci_register_taf_callback)
PHP_FALIAS(oci_free_cursor, oci_free_statement, arginfo_oci_free_statement)
PHP_FALIAS(ocifreecursor, oci_free_statement, arginfo_oci_free_statement)
@@ -1129,6 +1136,20 @@ PHP_MINIT_FUNCTION(oci)
REGISTER_LONG_CONSTANT("OCI_TEMP_CLOB",OCI_TEMP_CLOB, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_TEMP_BLOB",OCI_TEMP_BLOB, CONST_CS | CONST_PERSISTENT);
/* for Transparent Application Failover */
REGISTER_LONG_CONSTANT("OCI_FO_END", OCI_FO_END, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_FO_ABORT", OCI_FO_ABORT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_FO_REAUTH", OCI_FO_REAUTH, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_FO_BEGIN", OCI_FO_BEGIN, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_FO_ERROR", OCI_FO_ERROR, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_FO_NONE", OCI_FO_NONE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_FO_SESSION", OCI_FO_SESSION, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_FO_SELECT", OCI_FO_SELECT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_FO_TXNAL", OCI_FO_TXNAL, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("OCI_FO_RETRY", OCI_FO_RETRY, CONST_CS | CONST_PERSISTENT);
return SUCCESS;
}
@@ -1930,6 +1951,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection));
connection->hash_key = zend_string_dup(hashed_details.s, 0);
connection->is_persistent = 0;
ZVAL_UNDEF(&connection->taf_callback);
#ifdef HAVE_OCI8_DTRACE
connection->client_id = NULL;
#endif
@@ -1944,6 +1966,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
return NULL;
}
connection->is_persistent = 1;
ZVAL_UNDEF(&connection->taf_callback);
#ifdef HAVE_OCI8_DTRACE
connection->client_id = NULL;
#endif
@@ -1952,6 +1975,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
connection = (php_oci_connection *) ecalloc(1, sizeof(php_oci_connection));
connection->hash_key = zend_string_dup(hashed_details.s, 0);
connection->is_persistent = 0;
ZVAL_UNDEF(&connection->taf_callback);
#ifdef HAVE_OCI8_DTRACE
connection->client_id = NULL;
#endif
@@ -2225,6 +2249,15 @@ static int php_oci_connection_close(php_oci_connection *connection)
connection->client_id = NULL;
}
#endif /* HAVE_OCI8_DTRACE */
if (!Z_ISUNDEF(connection->taf_callback)) {
/* If it's NULL, then its value should be freed already */
if (!Z_ISNULL(connection->taf_callback)) {
zval_ptr_dtor(&connection->taf_callback);
}
ZVAL_UNDEF(&connection->taf_callback);
}
pefree(connection, connection->is_persistent);
connection = NULL;
OCI_G(in_call) = in_call_save;
@@ -2667,6 +2700,11 @@ static int php_oci_persistent_helper(zval *zv)
if (le->type == le_pconnection) {
connection = (php_oci_connection *)le->ptr;
/* Remove TAF callback function as it's bound to current request */
if (connection->used_this_request && !Z_ISUNDEF(connection->taf_callback) && !Z_ISNULL(connection->taf_callback)) {
php_oci_disable_taf_callback(connection);
}
if (!connection->used_this_request && OCI_G(persistent_timeout) != -1) {
#ifdef HAVE_OCI8_DTRACE
if (DTRACE_OCI8_CONNECT_EXPIRY_ENABLED()) {
+162
View File
@@ -0,0 +1,162 @@
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
| Copyright (c) 1997-2016 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Stig Sæther Bakken <ssb@php.net> |
| Thies C. Arntzen <thies@thieso.net> |
| |
| Collection support by Andy Sautins <asautins@veripost.net> |
| Temporary LOB support by David Benson <dbenson@mancala.com> |
| ZTS per process OCIPLogon by Harald Radi <harald.radi@nme.at> |
| |
| Redesigned by: Antony Dovgal <antony@zend.com> |
| Andi Gutmans <andi@zend.com> |
| Wez Furlong <wez@omniti.com> |
+----------------------------------------------------------------------+
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "php.h"
#include "ext/standard/info.h"
#include "php_ini.h"
#if HAVE_OCI8
#include "php_oci8.h"
#include "php_oci8_int.h"
/* {{{ callback_fn()
OCI TAF callback function, calling userspace function */
sb4 callback_fn(OCISvcCtx *svchp, OCIEnv *envhp, php_oci_connection *fo_ctx, ub4 fo_type, ub4 fo_event)
{
/* Create zval */
zval retval, params[3];
/* Default return value */
sb4 returnValue = 0;
/* Check if userspace callback function was disabled */
if (Z_ISUNDEF(fo_ctx->taf_callback) || Z_ISNULL(fo_ctx->taf_callback)) {
return 0;
}
/* Initialize zval */
ZVAL_RES(&params[0], fo_ctx->id);
ZVAL_LONG(&params[1], fo_event);
ZVAL_LONG(&params[2], fo_type);
/* Call user function (if possible) */
if (call_user_function(EG(function_table), NULL, &fo_ctx->taf_callback, &retval, 3, params) == FAILURE) {
php_error_docref(NULL, E_WARNING, "Unable to call taf callback function, is it defined?");
}
/* Set return value */
if (Z_TYPE(retval) == IS_LONG) {
returnValue = (sb4) Z_LVAL(retval);
}
/* Setting params[0] to null so ressource isn't destroyed on zval_dtor */
ZVAL_NULL(&params[0]);
/* Cleanup */
zval_dtor(&retval);
zval_dtor(&params[0]);
zval_dtor(&params[1]);
zval_dtor(&params[2]);
return returnValue;
}
/* }}} */
/* {{{ php_oci_disable_taf_callback()
Disables the userspace callback function for Oracle TAF,
while keeping the OCI callback alive */
int php_oci_disable_taf_callback(php_oci_connection *connection)
{
return php_oci_register_taf_callback(connection, NULL);
}
/* }}} */
/* {{{ php_oci_register_taf_callback()
Register a callback function for Oracle TAF */
int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback)
{
sword errstatus;
int registered = 0;
/* temporary failover callback structure */
OCIFocbkStruct failover;
if (!callback) {
/* Disable callback */
if (Z_ISUNDEF(connection->taf_callback) || Z_ISNULL(connection->taf_callback)) {
return 0; // Nothing to disable
}
registered = 1;
zval_ptr_dtor(&connection->taf_callback);
ZVAL_NULL(&connection->taf_callback);
} else {
if (!Z_ISUNDEF(connection->taf_callback)) {
registered = 1;
if (!Z_ISNULL(connection->taf_callback)) {
zval_ptr_dtor(&connection->taf_callback);
ZVAL_NULL(&connection->taf_callback);
}
}
/* Set userspace callback function */
ZVAL_COPY(&connection->taf_callback, callback);
}
/* OCI callback function already registered */
if (registered) {
return 0;
}
/* set context */
failover.fo_ctx = connection;
/* set callback function */
failover.callback_function = &callback_fn;
/* do the registration */
PHP_OCI_CALL_RETURN(errstatus, OCIAttrSet, (connection->server, (ub4) OCI_HTYPE_SERVER, (void *) &failover, (ub4) 0, (ub4) OCI_ATTR_FOCBK, connection->err));
if (errstatus != OCI_SUCCESS) {
zval_ptr_dtor(&connection->taf_callback);
ZVAL_UNDEF(&connection->taf_callback);
connection->errcode = php_oci_error(connection->err, errstatus);
return 1;
}
/* successful conclusion */
return 0;
}
/* }}} */
#endif /* HAVE_OCI8 */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: noet sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
+36
View File
@@ -42,6 +42,39 @@
#define OCI_STMT_CALL 10
#endif
/* {{{ proto bool oci_register_taf_callback( resource connection [, mixed callback] )
Register a callback function for Oracle Transparent Application Failover (TAF) */
PHP_FUNCTION(oci_register_taf_callback)
{
zval *z_connection;
php_oci_connection *connection;
zval *callback;
zend_string *callback_name;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|z!", &z_connection, &callback) == FAILURE) {
return;
}
if (callback) {
if (!zend_is_callable(callback, 0, &callback_name)) {
php_error_docref(NULL, E_WARNING, "function '%s' is not callable", ZSTR_VAL(callback_name));
zend_string_release(callback_name);
RETURN_FALSE;
}
zend_string_release(callback_name);
}
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
if (php_oci_register_taf_callback(connection, callback) == 0) {
RETURN_TRUE;
} else {
RETURN_FALSE;
}
}
/* }}} */
/* {{{ proto bool oci_define_by_name(resource stmt, string name, mixed &var [, int type])
Define a PHP variable to an Oracle column by name */
/* if you want to define a LOB/CLOB etc make sure you allocate it via OCINewDescriptor BEFORE defining!!! */
@@ -1553,6 +1586,9 @@ PHP_FUNCTION(oci_close)
internally Zend engine increments
RefCount value by 1 */
zend_list_close(connection->id);
/* Disable Oracle TAF */
php_oci_disable_taf_callback(connection);
/* ZVAL_NULL(z_connection); */
+18 -1
View File
@@ -46,7 +46,7 @@ Interoperability Support" (ID 207303.1) for details.
<active>no</active>
</lead>
<date>2017-04-12</date>
<date>2017-06-20</date>
<time>12:00:00</time>
<version>
@@ -447,6 +447,7 @@ Fixed uninitialized data causing random crash
<file name="oci8_interface.c" role="src" />
<file name="oci8_lob.c" role="src" />
<file name="oci8_statement.c" role="src" />
<file name="oci8_failover.c" role="src" />
<file name="php_oci8.h" role="src" />
<file name="php_oci8_int.h" role="src" />
<file name="README" role="doc" />
@@ -468,6 +469,22 @@ Fixed uninitialized data causing random crash
</extsrcrelease>
<changelog>
<release>
<version>
<release>2.1.5</release>
<api>2.1.5</api>
</version>
<stability>
<release>stable</release>
<api>stable</api>
</stability>
<license uri="http://www.php.net/license">PHP</license>
<notes>
This version is for PHP 7 only.
Added TAF callback support (PR #2459, KoenigsKind)
</notes>
</release>
<release>
<version>
<release>2.1.3</release>
+2 -1
View File
@@ -43,11 +43,12 @@
*/
#undef PHP_OCI8_VERSION
#endif
#define PHP_OCI8_VERSION "2.1.4"
#define PHP_OCI8_VERSION "2.1.5"
extern zend_module_entry oci8_module_entry;
#define phpext_oci8_ptr &oci8_module_entry
#define phpext_oci8_11g_ptr &oci8_module_entry
#define phpext_oci8_12c_ptr &oci8_module_entry
PHP_MINIT_FUNCTION(oci);
+9
View File
@@ -164,6 +164,8 @@ typedef struct {
#ifdef HAVE_OCI8_DTRACE
char *client_id; /* The oci_set_client_identifier() value */
#endif
zval taf_callback; /* The Oracle TAF callback function in the userspace */
} php_oci_connection;
/* }}} */
@@ -531,6 +533,13 @@ ZEND_BEGIN_MODULE_GLOBALS(oci) /* {{{ Module globals */
char *edition;
ZEND_END_MODULE_GLOBALS(oci) /* }}} */
/* {{{ transparent failover related prototypes */
int php_oci_register_taf_callback(php_oci_connection *connection, zval *callback);
int php_oci_disable_taf_callback(php_oci_connection *connection);
/* }}} */
#ifdef ZTS
#define OCI_G(v) TSRMG(oci_globals_id, zend_oci_globals *, v)
#else
+183
View File
@@ -0,0 +1,183 @@
--TEST--
Tests for LOBs with multibyte strings, reading them out in chunks
(Doc Bug #70700)
--CREDITS--
Chuck Burgess
ashnazg@php.net
--SKIPIF--
<?php
if (!extension_loaded('mbstring')) die('skip mbstring is not enabled');
$target_dbs = array('oracledb' => true, 'timesten' => false); // test runs on these DBs
require(dirname(__FILE__).'/skipif.inc');
?>
--ENV--
NLS_LANG=.AL32UTF8
--FILE--
<?php
require(dirname(__FILE__).'/connect.inc');
$stmt = oci_parse($c, 'DROP TABLE oci8_bug70700');
@oci_execute($stmt);
oci_free_statement($stmt);
$stmt = oci_parse($c, 'CREATE TABLE oci8_bug70700 (id NUMBER, data CLOB)');
oci_execute($stmt);
oci_free_statement($stmt);
$id = null;
$insert = oci_parse($c, 'INSERT INTO oci8_bug70700 (id, data) VALUES (:id, :data)');
oci_bind_by_name($insert, ':id', $id);
$select = oci_parse($c, "SELECT data FROM oci8_bug70700 WHERE id = :id");
oci_bind_by_name($select, ':id', $id);
echo PHP_EOL, 'Test 1: j', PHP_EOL;
$string1 = 'abc' . str_repeat('j', 1000000) . 'xyz';
$id = 1;
$desc = oci_new_descriptor($c, OCI_D_LOB);
oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB);
$desc->writeTemporary($string1, OCI_TEMP_CLOB);
oci_execute($insert);
$desc->save($string1);
oci_commit($c);
$desc->close();
oci_bind_by_name($select, ':id', $id);
oci_execute($select);
$row = oci_fetch_array($select, OCI_ASSOC);
$lob = $row['DATA'];
$fh = fopen('php://temp', 'rw');
while (! $lob->eof()) {
$data = $lob->read(8192); // read($characters), not read($bytes)
fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes)
}
$lob->free();
rewind($fh);
$stream1a = stream_get_contents($fh);
fclose($fh);
$start1a = mb_substr($stream1a, 0, 10);
$ending1a = mb_substr($stream1a, -10);
echo 'size of string1 is ', strlen($string1), ' bytes, ', mb_strlen($string1), ' chars.', PHP_EOL;
echo 'size of stream1a is ', strlen($stream1a), ' bytes, ', mb_strlen($stream1a), ' chars.', PHP_EOL;
echo 'beg of stream1a is ', $start1a, PHP_EOL;
echo 'end of stream1a is ', $ending1a, PHP_EOL;
echo PHP_EOL, 'Test 2: £', PHP_EOL;
$string2 = 'abc' . str_repeat('£', 4094) . 'xyz';
$id = 2;
$desc = oci_new_descriptor($c, OCI_D_LOB);
oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB);
$desc->writeTemporary($string2, OCI_TEMP_CLOB);
oci_execute($insert);
$desc->save($string2);
oci_commit($c);
$desc->close();
oci_bind_by_name($select, ':id', $id);
oci_execute($select);
$row = oci_fetch_array($select, OCI_ASSOC);
$lob = $row['DATA'];
$fh = fopen('php://temp', 'rw');
while (! $lob->eof()) {
$data = $lob->read(8192); // read($characters), not read($bytes)
fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes)
}
$lob->free();
rewind($fh);
$stream2a = stream_get_contents($fh);
fclose($fh);
$start2a = mb_substr($stream2a, 0, 10);
$ending2a = mb_substr($stream2a, -10);
echo 'size of string2 is ', strlen($string2), ' bytes, ', mb_strlen($string2), ' chars.', PHP_EOL;
echo 'size of stream2a is ', strlen($stream2a), ' bytes, ', mb_strlen($stream2a), ' chars.', PHP_EOL;
echo 'beg of stream2a is ', $start2a, PHP_EOL;
echo 'end of stream2a is ', $ending2a, PHP_EOL;
echo PHP_EOL, 'Test 3: Җ', PHP_EOL;
$string3 = 'abc' . str_repeat('Җ', 4094) . 'xyz';
$id = 3;
$desc = oci_new_descriptor($c, OCI_D_LOB);
oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB);
$desc->writeTemporary($string3, OCI_TEMP_CLOB);
oci_execute($insert);
$desc->save($string3);
oci_commit($c);
$desc->close();
oci_bind_by_name($select, ':id', $id);
oci_execute($select);
$row = oci_fetch_array($select, OCI_ASSOC);
$lob = $row['DATA'];
$fh = fopen('php://temp', 'rw');
while (! $lob->eof()) {
$data = $lob->read(8192); // read($characters), not read($bytes)
fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes)
}
$lob->free();
rewind($fh);
$stream3a = stream_get_contents($fh);
fclose($fh);
$start3a = mb_substr($stream3a, 0, 10);
$ending3a = mb_substr($stream3a, -10);
echo 'size of string3 is ', strlen($string3), ' bytes, ', mb_strlen($string3), ' chars.', PHP_EOL;
echo 'size of stream3a is ', strlen($stream3a), ' bytes, ', mb_strlen($stream3a), ' chars.', PHP_EOL;
echo 'beg of stream3a is ', $start3a, PHP_EOL;
echo 'end of stream3a is ', $ending3a, PHP_EOL;
echo PHP_EOL, 'Test 4: の', PHP_EOL;
$string4 = 'abc' . str_repeat('の', 2729) . 'xyz';
$id = 4;
$desc = oci_new_descriptor($c, OCI_D_LOB);
oci_bind_by_name($insert, ':data', $desc, -1, OCI_B_CLOB);
$desc->writeTemporary($string4, OCI_TEMP_CLOB);
oci_execute($insert);
$desc->save($string4);
oci_commit($c);
$desc->close();
oci_bind_by_name($select, ':id', $id);
oci_execute($select);
$row = oci_fetch_array($select, OCI_ASSOC);
$lob = $row['DATA'];
$fh = fopen('php://temp', 'rw');
while (! $lob->eof()) {
$data = $lob->read(8192); // read($characters), not read($bytes)
fwrite($fh, $data, strlen($data)); // fwrite(a, b, $bytes)
}
$lob->free();
rewind($fh);
$stream4a = stream_get_contents($fh);
fclose($fh);
$start4a = mb_substr($stream4a, 0, 10);
$ending4a = mb_substr($stream4a, -10);
echo 'size of string4 is ', strlen($string4), ' bytes, ', mb_strlen($string4), ' chars.', PHP_EOL;
echo 'size of stream4a is ', strlen($stream4a), ' bytes, ', mb_strlen($stream4a), ' chars.', PHP_EOL;
echo 'beg of stream4a is ', $start4a, PHP_EOL;
echo 'end of stream4a is ', $ending4a, PHP_EOL;
--EXPECTF--
Test 1: j
size of string1 is 1000006 bytes, 1000006 chars.
size of stream1a is 1000006 bytes, 1000006 chars.
beg of stream1a is abcjjjjjjj
end of stream1a is jjjjjjjxyz
Test 2: £
size of string2 is 8194 bytes, 4100 chars.
size of stream2a is 8194 bytes, 4100 chars.
beg of stream2a is abc£££££££
end of stream2a is £££££££xyz
Test 3: Җ
size of string3 is 8194 bytes, 4100 chars.
size of stream3a is 8194 bytes, 4100 chars.
beg of stream3a is abcҖҖҖҖҖҖҖ
end of stream3a is ҖҖҖҖҖҖҖxyz
Test 4: の
size of string4 is 8193 bytes, 2735 chars.
size of stream4a is 8193 bytes, 2735 chars.
beg of stream4a is abcののののののの
end of stream4a is のののののののxyz
+1 -1
View File
@@ -493,7 +493,7 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx)
zend_string_release(lc_name);
if (!m) {
if (!PG(enable_dl)) {
if (PG(enable_dl)) {
break;
} else {
ZVAL_FALSE(&t);
+14
View File
@@ -960,6 +960,17 @@ int validate_timestamp_and_record(zend_persistent_script *persistent_script, zen
}
}
int validate_timestamp_and_record_ex(zend_persistent_script *persistent_script, zend_file_handle *file_handle)
{
int ret;
SHM_UNPROTECT();
ret = validate_timestamp_and_record(persistent_script, file_handle);
SHM_PROTECT();
return ret;
}
/* Instead of resolving full real path name each time we need to identify file,
* we create a key that consist from requested file name, current working
* directory, current include_path, etc */
@@ -1712,7 +1723,10 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
return accelerator_orig_compile_file(file_handle, type);
}
persistent_script = zend_accel_hash_str_find(&ZCSG(hash), key, key_length);
} else if (UNEXPECTED(is_stream_path(file_handle->filename) && !is_cacheable_stream_path(file_handle->filename))) {
return accelerator_orig_compile_file(file_handle, type);
}
if (!persistent_script) {
/* try to find cached script by full real path */
zend_accel_hash_entry *bucket;
+1
View File
@@ -310,6 +310,7 @@ void zend_accel_schedule_restart(zend_accel_restart_reason reason);
void zend_accel_schedule_restart_if_necessary(zend_accel_restart_reason reason);
accel_time_t zend_get_file_handle_timestamp(zend_file_handle *file_handle, size_t *size);
int validate_timestamp_and_record(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
int validate_timestamp_and_record_ex(zend_persistent_script *persistent_script, zend_file_handle *file_handle);
int zend_accel_invalidate(const char *filename, int filename_len, zend_bool force);
int accelerator_shm_read_lock(void);
void accelerator_shm_read_unlock(void);
+3 -1
View File
@@ -221,8 +221,10 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
*/
#if defined(_WIN64)
void *vista_mapping_base_set[] = { (void *) 0x0000100000000000, (void *) 0x0000200000000000, (void *) 0x0000300000000000, (void *) 0x0000700000000000, 0 };
DWORD size_high = (requested_size >> 32), size_low = (requested_size & 0xffffffff);
#else
void *vista_mapping_base_set[] = { (void *) 0x20000000, (void *) 0x21000000, (void *) 0x30000000, (void *) 0x31000000, (void *) 0x50000000, 0 };
DWORD size_high = 0, size_low = requested_size;
#endif
void **wanted_mapping_base = default_mapping_base_set;
@@ -275,7 +277,7 @@ static int create_segments(size_t requested_size, zend_shared_segment ***shared_
shared_segment = (zend_shared_segment *)((char *)(*shared_segments_p) + sizeof(void *));
(*shared_segments_p)[0] = shared_segment;
memfile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, requested_size,
memfile = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, size_high, size_low,
create_name_with_username(ACCEL_FILEMAP_NAME));
if (memfile == NULL) {
err = GetLastError();
+55
View File
@@ -0,0 +1,55 @@
--TEST--
Bug #74596 (SIGSEGV with opcache.revalidate_path enabled)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.validate_timestamps=0
opcache.file_cache_only=0
opcache.revalidate_path=1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
file_put_contents(__DIR__ . "/bug74596_1.php", <<<CODE
<?php
class A {
public function __construct() {
\$a = true;
if (\$a) {
echo 1 + 2;
} else {
echo 2 + 3;
}
}
}
?>
CODE
);
file_put_contents(__DIR__ . "/bug74596_2.php", "ok\n");
class ufilter extends php_user_filter
{
function filter($in, $out, &$consumed, $closing)
{
include_once __DIR__ . "/bug74596_1.php";
while ($bucket = stream_bucket_make_writeable($in)) {
stream_bucket_append($out, $bucket);
}
return PSFS_PASS_ON;
}
}
stream_filter_register("ufilter", "ufilter");
include "php://filter/read=ufilter/resource=" . __DIR__ . "/bug74596_2.php";
?>
--CLEAN--
<?php
unlink(__DIR__ . "/bug74596_1.php");
unlink(__DIR__ . "/bug74596_2.php");
?>
--EXPECT--
ok
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #74663 (Segfault with opcache.memory_protect and validate_timestamp)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.enable_file_override=1
opcache.validate_timestamps=1
opcache.revalidate_freq=0
opcache.protect_memory=1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$file = __DIR__ . "/bug74663.inc";
file_put_contents($file, "");
include $file;
var_dump(is_file($file));
?>
--CLEAN--
<?php
unlink(__DIR__ . "/bug74663.inc");
--EXPECT--
bool(true)
+2 -2
View File
@@ -304,7 +304,7 @@ ZEND_INI_BEGIN()
STD_PHP_INI_ENTRY("opcache.optimization_level" , DEFAULT_OPTIMIZATION_LEVEL , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.optimization_level, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("opcache.opt_debug_level" , "0" , PHP_INI_SYSTEM, OnUpdateLong, accel_directives.opt_debug_level, zend_accel_globals, accel_globals)
STD_PHP_INI_BOOLEAN("opcache.enable_file_override" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.file_override_enabled, zend_accel_globals, accel_globals)
STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "1" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals)
STD_PHP_INI_BOOLEAN("opcache.enable_cli" , "0" , PHP_INI_SYSTEM, OnUpdateBool, accel_directives.enable_cli, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("opcache.error_log" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.error_log, zend_accel_globals, accel_globals)
STD_PHP_INI_ENTRY("opcache.restrict_api" , "" , PHP_INI_SYSTEM, OnUpdateString, accel_directives.restrict_api, zend_accel_globals, accel_globals)
@@ -342,7 +342,7 @@ static int filename_is_in_cache(zend_string *filename)
handle.type = ZEND_HANDLE_FILENAME;
if (ZCG(accel_directives).validate_timestamps) {
return validate_timestamp_and_record(persistent_script, &handle) == SUCCESS;
return validate_timestamp_and_record_ex(persistent_script, &handle) == SUCCESS;
}
return 1;
+44 -30
View File
@@ -87,6 +87,14 @@
#define HAVE_EVP_PKEY_EC 1
#endif
#ifdef PHP_WIN32
#define PHP_OPENSSL_BIO_MODE_R(flags) (((flags) & PKCS7_BINARY) ? "rb" : "r")
#define PHP_OPENSSL_BIO_MODE_W(flags) (((flags) & PKCS7_BINARY) ? "wb" : "w")
#else
#define PHP_OPENSSL_BIO_MODE_R(flags) "r"
#define PHP_OPENSSL_BIO_MODE_W(flags) "w"
#endif
ZEND_DECLARE_MODULE_GLOBALS(openssl)
/* FIXME: Use the openssl constants instead of
@@ -669,6 +677,11 @@ int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)
return 1;
}
static const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *asn1)
{
return M_ASN1_STRING_data(asn1);
}
#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER)
static int X509_get_signature_nid(const X509 *x)
@@ -838,9 +851,9 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
}
for (i = 0; i < X509_NAME_entry_count(name); i++) {
unsigned char *to_add = NULL;
const unsigned char *to_add = NULL;
int to_add_len = 0;
int needs_free = 0;
unsigned char *to_add_buf = NULL;
ne = X509_NAME_get_entry(name, i);
obj = X509_NAME_ENTRY_get_object(ne);
@@ -855,34 +868,36 @@ static void add_assoc_name_entry(zval * val, char * key, X509_NAME * name, int s
str = X509_NAME_ENTRY_get_data(ne);
if (ASN1_STRING_type(str) != V_ASN1_UTF8STRING) {
/* ASN1_STRING_to_UTF8(3): The converted data is copied into a newly allocated buffer */
to_add_len = ASN1_STRING_to_UTF8(&to_add, str);
needs_free = 1;
to_add_len = ASN1_STRING_to_UTF8(&to_add_buf, str);
to_add = to_add_buf;
} else {
/* ASN1_STRING_data(3): Since this is an internal pointer it should not be freed or modified in any way */
to_add = ASN1_STRING_data(str);
/* ASN1_STRING_get0_data(3): Since this is an internal pointer it should not be freed or modified in any way */
to_add = ASN1_STRING_get0_data(str);
to_add_len = ASN1_STRING_length(str);
}
if (to_add_len != -1) {
if ((data = zend_hash_str_find(Z_ARRVAL(subitem), sname, strlen(sname))) != NULL) {
if (Z_TYPE_P(data) == IS_ARRAY) {
add_next_index_stringl(data, (char *)to_add, to_add_len);
add_next_index_stringl(data, (const char *)to_add, to_add_len);
} else if (Z_TYPE_P(data) == IS_STRING) {
array_init(&tmp);
add_next_index_str(&tmp, zend_string_copy(Z_STR_P(data)));
add_next_index_stringl(&tmp, (char *)to_add, to_add_len);
add_next_index_stringl(&tmp, (const char *)to_add, to_add_len);
zend_hash_str_update(Z_ARRVAL(subitem), sname, strlen(sname), &tmp);
}
} else {
/* it might be better to expand it and pass zval from ZVAL_STRING
* to zend_symtable_str_update so we do not silently drop const
* but we need a test to cover this part first */
add_assoc_stringl(&subitem, sname, (char *)to_add, to_add_len);
}
} else {
php_openssl_store_errors();
}
if (needs_free) {
/* ASN1_STRING_to_UTF8(3): The buffer out should be freed using free(3) */
OPENSSL_free(to_add);
if (to_add_buf != NULL) {
OPENSSL_free(to_add_buf);
}
}
@@ -921,7 +936,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
timestr_len = (size_t)ASN1_STRING_length(timestr);
if (timestr_len != strlen((const char*)ASN1_STRING_data(timestr))) {
if (timestr_len != strlen((const char *)ASN1_STRING_get0_data(timestr))) {
php_error_docref(NULL, E_WARNING, "illegal length in timestamp");
return (time_t)-1;
}
@@ -936,7 +951,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME * timestr) /* {{{ */
return (time_t)-1;
}
strbuf = estrdup((char *)ASN1_STRING_data(timestr));
strbuf = estrdup((const char *)ASN1_STRING_get0_data(timestr));
memset(&thetime, 0, sizeof(thetime));
@@ -1845,21 +1860,19 @@ PHP_FUNCTION(openssl_spki_new)
s = zend_string_alloc(strlen(spkac) + strlen(spkstr), 0);
sprintf(ZSTR_VAL(s), "%s%s", spkac, spkstr);
ZSTR_LEN(s) = strlen(ZSTR_VAL(s));
OPENSSL_free(spkstr);
RETVAL_STR(s);
goto cleanup;
cleanup:
if (keyresource == NULL && spki != NULL) {
if (spki != NULL) {
NETSCAPE_SPKI_free(spki);
}
if (keyresource == NULL && pkey != NULL) {
EVP_PKEY_free(pkey);
}
if (keyresource == NULL && spkstr != NULL) {
efree(spkstr);
}
if (s && ZSTR_LEN(s) <= 0) {
RETVAL_FALSE;
@@ -2046,7 +2059,7 @@ PHP_FUNCTION(openssl_spki_export_challenge)
goto cleanup;
}
RETVAL_STRING((char *) ASN1_STRING_data(spki->spkac->challenge));
RETVAL_STRING((const char *)ASN1_STRING_get0_data(spki->spkac->challenge));
goto cleanup;
cleanup:
@@ -2237,19 +2250,19 @@ static int openssl_x509v3_subjectAltName(BIO *bio, X509_EXTENSION *extension)
case GEN_EMAIL:
BIO_puts(bio, "email:");
as = name->d.rfc822Name;
BIO_write(bio, ASN1_STRING_data(as),
BIO_write(bio, ASN1_STRING_get0_data(as),
ASN1_STRING_length(as));
break;
case GEN_DNS:
BIO_puts(bio, "DNS:");
as = name->d.dNSName;
BIO_write(bio, ASN1_STRING_data(as),
BIO_write(bio, ASN1_STRING_get0_data(as),
ASN1_STRING_length(as));
break;
case GEN_URI:
BIO_puts(bio, "URI:");
as = name->d.uniformResourceIdentifier;
BIO_write(bio, ASN1_STRING_data(as),
BIO_write(bio, ASN1_STRING_get0_data(as),
ASN1_STRING_length(as));
break;
default:
@@ -2941,6 +2954,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
if (d2i_PKCS12_bio(bio_in, &p12) && PKCS12_parse(p12, pass, &pkey, &cert, &ca)) {
BIO * bio_out;
int cert_num;
zval_dtor(zout);
array_init(zout);
@@ -2971,10 +2985,11 @@ PHP_FUNCTION(openssl_pkcs12_read)
BIO_free(bio_out);
}
if (ca && sk_X509_num(ca)) {
cert_num = sk_X509_num(ca);
if (ca && cert_num) {
array_init(&zextracerts);
for (i = 0; i < sk_X509_num(ca); i++) {
for (i = 0; i < cert_num; i++) {
zval zextracert;
X509* aCA = sk_X509_pop(ca);
if (!aCA) break;
@@ -2988,6 +3003,7 @@ PHP_FUNCTION(openssl_pkcs12_read)
}
X509_free(aCA);
BIO_free(bio_out);
}
sk_X509_free(ca);
@@ -4998,7 +5014,7 @@ PHP_FUNCTION(openssl_pkcs7_verify)
goto clean_exit;
}
in = BIO_new_file(filename, (flags & PKCS7_BINARY) ? "rb" : "r");
in = BIO_new_file(filename, PHP_OPENSSL_BIO_MODE_R(flags));
if (in == NULL) {
php_openssl_store_errors();
goto clean_exit;
@@ -5110,7 +5126,7 @@ PHP_FUNCTION(openssl_pkcs7_encrypt)
return;
}
infile = BIO_new_file(infilename, "r");
infile = BIO_new_file(infilename, PHP_OPENSSL_BIO_MODE_R(flags));
if (infile == NULL) {
php_openssl_store_errors();
goto clean_exit;
@@ -5268,7 +5284,7 @@ PHP_FUNCTION(openssl_pkcs7_sign)
goto clean_exit;
}
infile = BIO_new_file(infilename, "r");
infile = BIO_new_file(infilename, PHP_OPENSSL_BIO_MODE_R(flags));
if (infile == NULL) {
php_openssl_store_errors();
php_error_docref(NULL, E_WARNING, "error opening input file %s!", infilename);
@@ -5910,7 +5926,7 @@ PHP_FUNCTION(openssl_seal)
buf = emalloc(data_len + EVP_CIPHER_CTX_block_size(ctx));
EVP_CIPHER_CTX_cleanup(ctx);
if (!EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) ||
if (EVP_SealInit(ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) <= 0 ||
!EVP_SealUpdate(ctx, buf, &len1, (unsigned char *)data, (int)data_len) ||
!EVP_SealFinal(ctx, buf + len1, &len2)) {
efree(buf);
@@ -6214,9 +6230,7 @@ static int php_openssl_validate_iv(char **piv, size_t *piv_len, size_t iv_requir
if (mode->is_aead) {
if (EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_ivlen_flag, *piv_len, NULL) != 1) {
php_error_docref(NULL, E_WARNING,
"Setting of IV length for AEAD mode failed, the expected length is %zd bytes",
iv_required_len);
php_error_docref(NULL, E_WARNING, "Setting of IV length for AEAD mode failed");
return FAILURE;
}
return SUCCESS;
+27
View File
@@ -0,0 +1,27 @@
-----BEGIN CERTIFICATE-----
MIIEoDCCBAmgAwIBAgIBJzANBgkqhkiG9w0BAQQFADCBkDELMAkGA1UEFhMCUk8x
EDAOBgNVBAgTB1JvbWFuaWExEDAOBgNVBAcTB0NyYWlvdmExDzANBgNVBAoTBlNl
cmdpdTETMBEGA1UECxMKU2VyZ2l1IFNSTDESMBAGA1UEAxMJU2VyZ2l1IENBMSMw
IQYJKoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTAeFw0wNDA1MTQxMzM0
NTZaFw0wNTA1MTQxMzM0NTZaMIGaMQswCQYDVQQGEwJSTzEQMA4GA1UECBMHUm9t
YW5pYTEQMA4GA1UEBxMHQ3JhaW92YTETMBEGA1UEChMKU2VyZ2l1IFNSTDETMBEG
A1UECxMKU2VyZ2l1IFNSTDEYMBYGA1UEAxMPU2VyZ2l1IHBlcnNvbmFsMSMwIQYJ
KoZIhvcNAQkBFhRuX3NlcmdpdUBob3RtYWlsLmNvbTCBnzANBgkqhkiG9w0BAQEF
AAO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6/pwgsp+Z2GvEsDG1qCKnvNpf6
-----END CERTIFICATE-----
+1 -1
View File
@@ -10,7 +10,7 @@ if (OPENSSL_VERSION_NUMBER < 0x009070af) die("skip");
$configargs = array(
"req_extensions" => "v3_req",
"x509_extensions" => "usr_cert",
"config" => __DIR__."/openssl.cnf",
"config" => __DIR__. DIRECTORY_SEPARATOR . "openssl.cnf",
);
$dn = array(
+1 -1
View File
@@ -19,7 +19,7 @@ $csr_info = array(
$private = openssl_pkey_new($config);
while (openssl_error_string()) {}
$csr_res = openssl_csr_new($csr_info, $private,
['config' => __DIR__."/openssl.cnf"]);
['config' => __DIR__. DIRECTORY_SEPARATOR . "openssl.cnf"]);
if (!$csr_res) {
while ($e = openssl_error_string()) { $err = $e; }
die("Failed; last error: $err");
+3 -2
View File
@@ -7,11 +7,12 @@ if (!extension_loaded("openssl")) die("skip openssl not loaded");
--FILE--
<?php
$passwords = ["abc\x00defghijkl", "abcdefghikjl"];
$conf = ['config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'];
foreach($passwords as $password) {
$key = openssl_pkey_new();
$key = openssl_pkey_new($conf);
if (openssl_pkey_export($key, $privatePEM, $password) === false) {
if (openssl_pkey_export($key, $privatePEM, $password, $conf) === false) {
echo "Failed to encrypt.\n";
} else {
echo "Encrypted!\n";
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #74022 PHP Fast CGI crashes when reading from a pfx file with valid password, multiple extra certs
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
function test($p12_contents, $password) {
openssl_pkcs12_read($p12_contents, $cert_data, $password);
openssl_error_string();
var_dump(count($cert_data['extracerts']));
}
$p12_base64 = 'MIIW+QIBAzCCFr8GCSqGSIb3DQEHAaCCFrAEghasMIIWqDCCEV8GCSqGSIb3DQEHBqCCEVAwghFMAgEAMIIRRQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIQOfCxIAgGIICAggAgIIRGFTkvHpJjCt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1k76vI3K2lqERkaNYFfzRNj+e7k+NNos8w7XCzilWBL2ePB3pG5xfivcH4tYFm0FbnIkSz52VIy+PTiK7QQuBPDRTcn1k41+9vxQxRWpsqM/NP+4gqGozNyANXLQ64Y+QXSnWrD+xMjL/kVFwUBJ2HaAIJHjZ7ZqLRzXVOUbQ9pivJiBkXvLptSo72Iw4zsbRd1x8WNEaihx1MBAj+s+4MNdC5MBkQMlSB0PTJzs9xlz0gN+Oz0lohH6JO7ngPJUYbo2AIWEYZN+9kn/RyHblQTElrJeLf1jGNi4anBfzbsIXQuVm/nsrE5MH23X66+rJzUk8Fc5JAIDGBslkDPg3UNnElcE3cYbcB/ZzjFtgz8ducWKQmI+Yqv4p7BVXji/rHPim8vL6P5xZc95tbIonp5bQH+PPSmcfDk3rrf5mS58dJvWh/UpwcfdVvUAsWLJEV1lUBg1qecVbCsa6Oy7tJ2ZK7e3KdtZrmXiYpSAnSzRNJotr4g4H99brG6IwUx3qk5BE4Line truncated
$p12 = base64_decode($p12_base64);
test($p12, 'qwerty');
?>
===DONE===
--EXPECTF--
int(2)
===DONE===
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #74651: negative-size-param (-1) in memcpy in zif_openssl_seal()
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
?>
--FILE--
<?php
$inputstr = file_get_contents(__DIR__ . "/74651.pem");
$pub_key_id = openssl_get_publickey($inputstr);
var_dump($pub_key_id);
var_dump(openssl_seal($inputstr, $sealed, $ekeys, array($pub_key_id, $pub_key_id), 'AES-128-ECB'));
?>
--EXPECTF--
resource(%d) of type (OpenSSL key)
bool(false)
+93
View File
@@ -0,0 +1,93 @@
--TEST--
Bug #74720 pkcs7_en/decrypt does not work if \x1a is used in content, variant 0
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
$cert = "-----BEGIN CERTIFICATE-----
MIIDXDCCAkSgAwIBAgIKq/f5U3FzthdKUzANBgkqhkiG9w0BA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AQIHt19wIRjoGOFatAj6TQ5gUj9Remn12v6d5Wi02i7hlu8V6O1VXLGqqeQ27
0MHBXzrFBVljOz96D7VP5Xx0DB1cGMbtg5ivjd91OUVrwC7fbXE9sfOI1FqlTb7p
6xi9Wl+fmQKBgGdzR/vUfqPOvVcq7gBUaAmb2KcUrj65rU753MJUy2h1EuHHRi1k
07fl+VZD0rALJf7bp6laajcebyLWYGdPXkNwqT8ua7naaOSiogLSiSvXhoKP56PG
H+HNLWwp+lAia2Erky0IWstsow62yWvLDyTCM+QhqlHwnh3TJVvNI1GBAoGAUl+y
MOJ6z5Ql2aqc0UwT1i1Tlxz5s73D93Tlho1Ovp3E5Bg6OK4kt9CwMNe0IhF2GGgQ
+l1cj6kIF6Fk8cR6r46QwDM0p3a1VMPQZNx0+NFxzkot7FsuY26lJyyG5fFUhiXw
VE4ifoN1Mg3+MWg3657jG66hihNd77WgU9uM3TkCgYEAypuvVrfFrrtXnbEUcBHq
mguKumn9miD9DPb6gi8ZaKOddGzw+qFPukiqi7rM3oRMg02evfK/VQC87Gmev663
RV9sQOlB9gNlMOOw/0R3ABEWDoSRCcrLhb6Z5Y72WVnZvpTPO0cDw2i1hyaEM6d+
2WR7c6FhRCLxG0DObEOfiO0=
-----END PRIVATE KEY-----
";
$originalEnvelopeData = "any string with \x1a is cut at this point.";
$tmpFileIn = tempnam(sys_get_temp_dir(), 'test');
$tmpFileOut = tempnam(sys_get_temp_dir(), 'test');
file_put_contents($tmpFileIn, $originalEnvelopeData);
var_dump(filesize($tmpFileIn) === strlen($originalEnvelopeData));
openssl_pkcs7_encrypt($tmpFileIn, $tmpFileOut, [$cert], array(), PKCS7_BINARY, OPENSSL_CIPHER_AES_128_CBC);
$tmpFileOut2 = tempnam(sys_get_temp_dir(), 'test');
openssl_pkcs7_decrypt($tmpFileOut, $tmpFileOut2, $cert, $pkey);
$envelopeData = file_get_contents($tmpFileOut2);
var_dump($originalEnvelopeData === $envelopeData); // need to be true
var_dump(strlen($originalEnvelopeData), strlen($envelopeData), filesize($tmpFileOut2));
unlink($tmpFileIn);
unlink($tmpFileOut);
unlink($tmpFileOut2);
?>
==DONE==
--EXPECTF--
bool(true)
bool(true)
int(39)
int(39)
int(39)
==DONE==
+88
View File
@@ -0,0 +1,88 @@
--TEST--
Bug #74720 pkcs7_en/decrypt does not work if \x1a is used in content, variant 1
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
$cert = "-----BEGIN CERTIFICATE-----
MIIDXDCCAkSgAwIBAgIKq/f5U3FzthdKUzANBgkqhkiG9w0BAQUFADBcMRIwEAYD
VQQDEwlzZXRhcGRmLWExCTAHBgNVBAoTADEJMAcGA1UECxMAMSMwIQYJKoZIhvcN
AQkBFhRzdXBwb3J0QHNldGFzaWduLmNvbTELMAkGA1UEBhMCREUwHhcNMTUwOTA4
MDkzNDExWhcNMjAwOTA4MDkzNDExWjBcMRIwEAYDVQQDEwlzZXRhcGRmLWExCTAH
BgNVBAoTADEJMAcGA1UECxMAMSMwIQYJKoZIhvcNAQkBFhRzdXBwb3J0QHNldGFz
aWduLmNvbTELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK
AoIBAQCkmTLvUIYfqAKC1CHVgABlemrFIVRm4JGeB0jIGofyrm3yVwR4YcK0eUmt
/0nbFfsFsU0/C9dXKZYD42t5YpLFsj666Z1EoU1CfSIW2bf0HaWVJ+oNT5twS3dv
RTzAcnPM44GxO4y6GUW6un0/bT/MZbFKbb3NI1L0mwY7EoqUXR68XxuHqWETaslm
Sbp1XvbLsJjgV9X3ihi7JC7A9kEzrKh+RBsXEXwlSv5JO2TUdwq9P4EbjqvgiaV1
vFNAArioX5pIUIm9ahAm8d7jjW6DFfV798rTzaQ3GJs0yC3UD6xhmbTbdC/D9Pot
8RGu89Fx6E+O5j4LwGH4kiYjgvYZAgMBAAGjIDAeMA8GCSqGSIb3LwEBCgQCBQAw
CwYDVR0PBAQDAgOYMA0GCSq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CJ8wxUVM1+Ks1D3vKHfeAhCFHvj9M/lf5OWylhmQh4CQf+NMDNsAc6
mXNIzUvZEgs/PJpd3SymHchf60m6faJtGv43GsdsgQKBgQDUx8t649O/vGRI26t4
4XrzVC2w5271UlhFaRiH03BrV+pECVoH4bw+ZIUuGke2xe+LrNkhMNJSGcbB0WDa
Jes+4Gf++AuSXRvMo+xHenfgUWQqYHJPkh5q6gknZ2YDfikFNLdqApXvp0m+FaVP
+F/2HMjQfTITQgkAiEn45s4agQKBgQDGCAZkIUcdyXQTplLE0Zx1/uiTBrQGyzsb
cDgAQIHt19wIRjoGOFatAj6TQ5gUj9Remn12v6d5Wi02i7hlu8V6O1VXLGqqeQ27
0MHBXzrFBVljOz96D7VP5Xx0DB1cGMbtg5ivjd91OUVrwC7fbXE9sfOI1FqlTb7p
6xi9Wl+fmQKBgGdzR/vUfqPOvVcq7gBUaAmb2KcUrj65rU753MJUy2h1EuHHRi1k
07fl+VZD0rALJf7bp6laajcebyLWYGdPXkNwqT8ua7naaOSiogLSiSvXhoKP56PG
H+HNLWwp+lAia2Erky0IWstsow62yWvLDyTCM+QhqlHwnh3TJVvNI1GBAoGAUl+y
MOJ6z5Ql2aqc0UwT1i1Tlxz5s73D93Tlho1Ovp3E5Bg6OK4kt9CwMNe0IhF2GGgQ
+l1cj6kIF6Fk8cR6r46QwDM0p3a1VMPQZNx0+NFxzkot7FsuY26lJyyG5fFUhiXw
VE4ifoN1Mg3+MWg3657jG66hihNd77WgU9uM3TkCgYEAypuvVrfFrrtXnbEUcBHq
mguKumn9miD9DPb6gi8ZaKOddGzw+qFPukiqi7rM3oRMg02evfK/VQC87Gmev663
RV9sQOlB9gNlMOOw/0R3ABEWDoSRCcrLhb6Z5Y72WVnZvpTPO0cDw2i1hyaEM6d+
2WR7c6FhRCLxG0DObEOfiO0=
-----END PRIVATE KEY-----
";
$tmpPath = tempnam(sys_get_temp_dir(), 'test');
$content = "A simple \x1a test.";
file_put_contents($tmpPath, $content);
$outPath = tempnam(sys_get_temp_dir(), 'test');
openssl_pkcs7_sign(
$tmpPath,
$outPath,
$cert,
$pkey,
array(),
PKCS7_BINARY | PKCS7_DETACHED
);
var_dump(strpos(file_get_contents($outPath), $content) !== false);
unlink($tmpPath);
unlink($outPath);
?>
==DONE==
--EXPECTF--
bool(true)
==DONE==
+7
View File
@@ -1,3 +1,10 @@
oid_section = new_oids
[ new_oids ]
# Example policies to test their
tsa_policy1 = 1.2.3.4.1
tsa_policy2 = 1.2.3.4.5.6
[ req ]
default_bits = 1024
default_keyfile = privkey.pem
+1 -1
View File
@@ -35,7 +35,7 @@ var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
TEST 0
bool(true)
Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed, the expected length is 12 bytes in %s on line %d
Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed in %s on line %d
bool(false)
bool(false)
bool(false)
+1 -1
View File
@@ -45,7 +45,7 @@ bool(true)
TEST 5
bool(true)
Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed, the expected length is 12 bytes in %s on line %d
Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed in %s on line %d
bool(false)
bool(false)
bool(false)
+1 -1
View File
@@ -33,7 +33,7 @@ TEST 0
bool(true)
bool(true)
Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed, the expected length is 12 bytes in %s on line %d
Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed in %s on line %d
bool(false)
string(8) "p/lvgA=="
int(1024)
+1 -1
View File
@@ -50,7 +50,7 @@ TEST 5
bool(true)
bool(true)
Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed, the expected length is 12 bytes in %s on line %d
Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed in %s on line %d
bool(false)
Warning: openssl_encrypt(): Retrieving verification tag failed in %s on line %d
@@ -0,0 +1,55 @@
--TEST--
openssl_pkcs12_export() tests
--SKIPIF--
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
$cert_file = dirname(__FILE__) . "/public.crt";
$cert = file_get_contents($cert_file);
$cert_path = "file://" . $cert_file;
$priv_file = dirname(__FILE__) . "/private.crt";
$priv = file_get_contents($priv_file);
$priv_path = "file://" . $priv_file;
$cert_res = openssl_x509_read($cert);
$priv_res = openssl_pkey_get_private($priv);
$pass = "test";
$invalid = "";
$invalid_path = "file:///tmp/php";
$opts = [];
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass)); // read certs as a string
var_dump(openssl_pkcs12_read($output, $opts, $pass));
var_dump(openssl_pkcs12_export($cert_path, $output, $priv_path, $pass)); // read certs from a filename string
var_dump(openssl_pkcs12_read($output, $opts, $pass));
var_dump(openssl_pkcs12_export($cert_res, $output, $priv_res, $pass)); // read certs from a resource
var_dump(openssl_pkcs12_read($output, $opts, $pass));
var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array($cert))); // extra optional cert
var_dump(openssl_pkcs12_read($output, $opts, $pass));
//var_dump(count($opts)); // should be 3 certificates, priv, pub, extra optional cert
var_dump(openssl_pkcs12_export($invalid, $output, $invalid, $pass));
var_dump(openssl_pkcs12_export($invalid_path, $output, $invalid_path, $pass));
var_dump(openssl_pkcs12_export($priv_res, $output, $cert_res, $pass));
//var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array("foo")));
?>
--EXPECTF--
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
Warning: openssl_pkcs12_export(): cannot get cert from parameter 1 in %s on line %d
bool(false)
Warning: openssl_pkcs12_export(): cannot get cert from parameter 1 in %s on line %d
bool(false)
Warning: openssl_pkcs12_export(): supplied resource is not a valid OpenSSL X.509 resource in %s on line %d
Warning: openssl_pkcs12_export(): cannot get cert from parameter 1 in %s on line %d
bool(false)
@@ -0,0 +1,97 @@
--TEST--
openssl_pkcs12_read() tests
--SKIPIF--
<?php if (!extension_loaded("openssl")) print "skip"; ?>
--FILE--
<?php
$p12_file = dirname(__FILE__) . "/p12_with_extra_certs.p12";
$p12 = file_get_contents($p12_file);
$certs = array();
$pass = "qwerty";
var_dump(openssl_pkcs12_read("", $certs, ""));
var_dump(openssl_pkcs12_read($p12, $certs, ""));
var_dump(openssl_pkcs12_read($p12, $certs, $pass));
var_dump($certs);
?>
--EXPECTF--
bool(false)
bool(false)
bool(true)
array(3) {
["cert"]=>
string(1111) "-----BEGIN CERTIFICATE-----
MIIDBjCCAe4CCQCS/had1ITjDjANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJQ
TDETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
cyBQdHkgTHRkMB4XDTE1MDYxMDEyMTI0N1oXDTE2MDYwOTEyMTI0N1owRTELMAkG
A1UEBhMCUEwxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
ANHezJRoGMbtDzSwK7WPjj6+Yhj7R9LJyR7TjvxH01ZVA+sHUrcXs3tDXukIQcH1
rsnf4WbBjGbQT3jlLicsll6gMOh8oaCdi6863cvw1XRUmlezpAs2V5MZOEgqkWvU
8OKHqjt8o9F07T3n1zYeeBjiUsr6UWqX4+Znwa25UF0Fid1R4BxmX7GpDoq0Weuv
WQafbM9qs3Qrd7Ea3Lqz9pGkWx1BmOv49XorAhQadxCT32GbUdhmhxgrDgyW5M7m
ECz4DngZLhZvLC8Juf/Q6R5SjhN5/f/TBq//QpKaCjBAamhZDJtWMv80IDKJO7Ir
fQMnPEq4vCnHdKvG7N6ZjsECAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAHGAiEN0o
tOV2tbK0Qm/mWlyuRKtxqnP3y/2Q5SFMmRpkOS54hFf9YBNgT7nWK3Z5fPKor17t
rGthXPSZU8hxY5iHFhELurp23qGmJftdcYL2mF7IyoGOiZ1Q6Vt9LnRTDtgrHh/f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ZYRKJzAG4+
TitDjnjzDRcwXMxrXV9AoH52WPZsuays+ulMm8C1F42vgSBPH/NHEpt9MQKBgAIw
nLDvG/K376Zy7t34Uf5R6p7vpKpcpyumaL15XrTmAXwJOX7eBIOWybhG0jHWlktq
J72U4JlmXjHc55Iq3mIVwPlJc2uep+NOLTyHt1b5n4Xmxs8EDJzO9Ud2OOR0lAdI
ykYczdEMfHCBD0gW8jGIUpXSTlilvkxKcGR5VwpBAoGBANdAWL3lw+/P43x6Rxth
GJN8QzWe5vRFJYS5mkeaa/6jrFrsvk176WudopropFGtRc/44E1IDOZULJM80Xgb
JTeUFyb+ZjYLrHUp1yir+oZIm5DBZDZjYclanrPPHg9YwVxcHtunPeCFy3iC+W+F
MK80GEnRQIkB7uZVk+r0HusK
-----END PRIVATE KEY-----
+23
View File
@@ -0,0 +1,23 @@
Bag Attributes
localKeyID: E1 BC BF 63 1E 2A A4 F6 4C 71 6B E7 CE E2 6D 4A 95 CD 26 5B
subject=/C=PL/ST=Some-State/O=Internet Widgits Pty Ltd
issuer=/C=PL/ST=Some-State/O=Internet Widgits Pty Ltd
-----BEGIN CERTIFICATE-----
MIIDBjCCAe4CCQCS/had1ITjDjANBgkqhkiG9w0BAQsFADBFMQswCQYDVQQGEwJQ
TDETMBEGA1UECAwKU29tZS1TdGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0
cyBQdHkgTHRkMB4XDTE1MDYxMDEyMTI0N1oXDTE2MDYwOTEyMTI0N1owRTELMAkG
A1UEBhMCUEwxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0
IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
ANHezJRoGMbtDzSwK7WPjj6+Yhj7R9LJyR7TjvxH01ZVA+sHUrcXs3tDXukIQcH1
rsnf4WbBjGbQT3jlLicsll6gMOh8oaCdi6863cvw1XRUmlezpAs2V5MZOEgqkWvU
8OKHqjt8o9F07T3n1zYeeBjiUsr6UWqX4+Znwa25UF0Fid1R4BxmX7GpDoq0Weuv
WQafbM9qs3Qrd7Ea3Lqz9pGkWx1BmOv49XorAhQadxCT32GbUdhmhxgrDgyW5M7m
ECz4DngZLhZvLC8Juf/Q6R5SjhN5/f/TBq//QpKaCjBAamhZDJtWMv80IDKJO7Ir
fQMnPEq4vCnHdKvG7N6ZjsECAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAHGAiEN0o
tOV2tbK0Qm/mWlyuRKtxqnP3y/2Q5SFMmRpkOS54hFf9YBNgT7nWK3Z5fPKor17t
rGthXPSZU8hxY5iHFhELurp23qGmJftdcYL2mF7IyoGOiZ1Q6Vt9LnRTDtgrHh/f
ZziI+gaPpmAfEAh48xQrlviHqaR9F63d0UN1jz9cF1kIj1H21PAGC0tmAIxxb4ee
hjipL+JLH0iRoBQE83cF2BOQCfRzRekotnDYon6v7mTjYu7kwl8paRIEMNrBckby
IL3CJOZFesaFO7suK7oP7r6BIATpVcg2m0V25mVMVFRm4F/JOvSkB381Pte/Ccuv
dxPWHER13ptIVg==
-----END CERTIFICATE-----
+1
View File
@@ -3,6 +3,7 @@ sni_server
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip openssl not loaded");
if (OPENSSL_VERSION_NUMBER >= 0x10100000) die("skip OpenSSL < v1.1.0 required");
--FILE--
<?php
$serverCode = <<<'CODE'
+1 -1
View File
@@ -7307,7 +7307,7 @@ if (opcode == OP_COND || opcode == OP_SCOND)
if (*matchingpath == OP_FAIL)
stacksize = 0;
if (*matchingpath == OP_RREF)
else if (*matchingpath == OP_RREF)
{
stacksize = GET2(matchingpath, 1);
if (common->currententry == NULL)
+27 -13
View File
@@ -2,16 +2,31 @@ dnl $Id$
dnl config.m4 for extension pdo_oci
dnl vim:et:sw=2:ts=2:
SUPPORTED_LIB_VERS="9.0 10.1 11.1 12.1" # The lib vers are not bumped when the DB version is bumped
if test -z "$SED"; then
PHP_PDO_OCI_SED="sed";
else
PHP_PDO_OCI_SED="$SED";
fi
PHP_PDO_OCI_TAIL1=`echo a | tail -n1 2>/dev/null`
if test "$PHP_PDO_OCI_TAIL1" = "a"; then
PHP_PDO_OCI_TAIL1="tail -n1"
else
PHP_PDO_OCI_TAIL1="tail -1"
fi
AC_DEFUN([AC_PDO_OCI_VERSION],[
AC_MSG_CHECKING([Oracle version])
for OCI_VER in $SUPPORTED_LIB_VERS; do
if test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.$OCI_VER; then
PDO_OCI_VERSION="$OCI_VER"
fi
done
if test -z "$PDO_OCI_VERSION"; then
AC_MSG_ERROR([Oracle required OCI8 libraries not found under $PDO_OCI_DIR])
PDO_OCI_LCS_BASE=$PDO_OCI_LIB_DIR/libclntsh.$SHLIB_SUFFIX_NAME
PDO_OCI_LCS=`ls $PDO_OCI_LCS_BASE.*.1 2> /dev/null | $PHP_PDO_OCI_TAIL1` # Oracle 10g, 11g, 12c etc
if test -f "$PDO_OCI_LCS"; then
dnl Oracle 10g, 11g 12c etc. The x.2 version libraries are named x.1 for drop in compatibility
PDO_OCI_VERSION=`echo $PDO_OCI_LCS | $PHP_PDO_OCI_SED -e 's/.*\.\(.*\)\.1$/\1.1/'`
elif test -f $PDO_OCI_LCS_BASE.9.0; then
dnl There is no case for Oracle 9.2. Oracle 9.2 libraries have a 9.0 suffix for drop-in compatibility with Oracle 9.0
PDO_OCI_VERSION=9.0
else
AC_MSG_ERROR(Oracle libclntsh.$SHLIB_SUFFIX_NAME client library not found or its version is lower than 9)
fi
AC_MSG_RESULT($PDO_OCI_VERSION)
])
@@ -147,13 +162,12 @@ You need to tell me where to find your Oracle Instant Client SDK, or set ORACLE_
fi
case $PDO_OCI_VERSION in
9.0|10.1|10.2|11.1|11.2|12.1)
PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
;;
*)
7.3|8.0|8.1)
AC_MSG_ERROR(Unsupported Oracle version $PDO_OCI_VERSION)
;;
*)
PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
;;
esac
PHP_ADD_LIBPATH($PDO_OCI_LIB_DIR, PDO_OCI_SHARED_LIBADD)
+124
View File
@@ -0,0 +1,124 @@
--TEST--
PDO OCI Bug #60994 (Reading a multibyte CLOB caps at 8192 characters)
--CREDITS--
Chuck Burgess
ashnazg@php.net
--SKIPIF--
<?php
/* $Id$ */
if (!extension_loaded('mbstring') || !extension_loaded('pdo') || !extension_loaded('pdo_oci')) die('skip not loaded');
require dirname(__FILE__).'/../../pdo/tests/pdo_test.inc';
if (!strpos(strtolower(getenv('PDOTEST_DSN')), 'charset=al32utf8')) die('skip expected output valid for AL32UTF8 character set');
PDOTest::skip();
?>
--FILE--
<?php
require 'ext/pdo/tests/pdo_test.inc';
$dbh = PDOTest::factory();
$dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_NATURAL);
$dbh->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
@$dbh->exec('DROP TABLE pdo_oci_bug60994');
$dbh->exec('CREATE TABLE pdo_oci_bug60994 (id NUMBER, data CLOB)');
$id = null;
$insert = $dbh->prepare('INSERT INTO pdo_oci_bug60994 (id, data) VALUES (:id, :data)');
$insert->bindParam(':id', $id, \PDO::PARAM_STR);
$select = $dbh->prepare("SELECT data FROM pdo_oci_bug60994 WHERE id = :id");
echo PHP_EOL, 'Test 1: j', PHP_EOL;
$string1 = 'abc' . str_repeat('j', 8187) . 'xyz'; // 8193 chars total works fine here (even 1 million works fine, subject to memory_limit)
$id = 1;
$insert->bindParam(':data', $string1, \PDO::PARAM_STR, strlen($string1)); // length in bytes
$insert->execute();
$select->bindParam(':id', $id, \PDO::PARAM_STR);
$select->execute();
$row = $select->fetch();
$stream1 = stream_get_contents($row['DATA']);
$start1 = mb_substr($stream1, 0, 10);
$ending1 = mb_substr($stream1, -10);
echo 'size of string1 is ', strlen($string1), ' bytes, ', mb_strlen($string1), ' chars.', PHP_EOL;
echo 'size of stream1 is ', strlen($stream1), ' bytes, ', mb_strlen($stream1), ' chars.', PHP_EOL;
echo 'beg of stream1 is ', $start1, PHP_EOL;
echo 'end of stream1 is ', $ending1, PHP_EOL;
echo PHP_EOL, 'Test 2: £', PHP_EOL;
$string2 = 'abc' . str_repeat('£', 8187) . 'xyz'; // 8193 chars total is when it breaks
$id = 2;
$insert->bindParam(':data', $string2, \PDO::PARAM_STR, strlen($string2)); // length in bytes
$insert->execute();
$select->bindParam(':id', $id, \PDO::PARAM_STR);
$select->execute();
$row = $select->fetch();
$stream2 = stream_get_contents($row['DATA']);
$start2 = mb_substr($stream2, 0, 10);
$ending2 = mb_substr($stream2, -10);
echo 'size of string2 is ', strlen($string2), ' bytes, ', mb_strlen($string2), ' chars.', PHP_EOL;
echo 'size of stream2 is ', strlen($stream2), ' bytes, ', mb_strlen($stream2), ' chars.', PHP_EOL;
echo 'beg of stream2 is ', $start2, PHP_EOL;
echo 'end of stream2 is ', $ending2, PHP_EOL;
echo PHP_EOL, 'Test 3: Җ', PHP_EOL;
$string3 = 'abc' . str_repeat('Җ', 8187) . 'xyz'; // 8193 chars total is when it breaks
$id = 3;
$insert->bindParam(':data', $string3, \PDO::PARAM_STR, strlen($string3)); // length in bytes
$insert->execute();
$select->bindParam(':id', $id, \PDO::PARAM_STR);
$select->execute();
$row = $select->fetch();
$stream3 = stream_get_contents($row['DATA']);
$start3 = mb_substr($stream3, 0, 10);
$ending3 = mb_substr($stream3, -10);
echo 'size of string3 is ', strlen($string3), ' bytes, ', mb_strlen($string3), ' chars.', PHP_EOL;
echo 'size of stream3 is ', strlen($stream3), ' bytes, ', mb_strlen($stream3), ' chars.', PHP_EOL;
echo 'beg of stream3 is ', $start3, PHP_EOL;
echo 'end of stream3 is ', $ending3, PHP_EOL;
echo PHP_EOL, 'Test 4: の', PHP_EOL;
$string4 = 'abc' . str_repeat('の', 8187) . 'xyz'; // 8193 chars total is when it breaks
$id = 4;
$insert->bindParam(':data', $string4, \PDO::PARAM_STR, strlen($string4)); // length in bytes
$insert->execute();
$select->bindParam(':id', $id, \PDO::PARAM_STR);
$select->execute();
$row = $select->fetch();
$stream4 = stream_get_contents($row['DATA']);
$start4 = mb_substr($stream4, 0, 10);
$ending4 = mb_substr($stream4, -10);
echo 'size of string4 is ', strlen($string4), ' bytes, ', mb_strlen($string4), ' chars.', PHP_EOL;
echo 'size of stream4 is ', strlen($stream4), ' bytes, ', mb_strlen($stream4), ' chars.', PHP_EOL;
echo 'beg of stream4 is ', $start4, PHP_EOL;
echo 'end of stream4 is ', $ending4, PHP_EOL;
--XFAIL--
Fails due to Bug 60994
--EXPECTF--
Test 1: j
size of string1 is 1000006 bytes, 1000006 chars.
size of stream1 is 1000006 bytes, 1000006 chars.
beg of stream1 is abcjjjjjjj
end of stream1 is jjjjjjjxyz
Test 2: £
size of string2 is 16380 bytes, 8193 chars.
size of stream2 is 16380 bytes, 8193 chars.
beg of stream2 is abc£££££££
end of stream2 is £££££££xyz
Test 3: Җ
size of string3 is 16380 bytes, 8193 chars.
size of stream3 is 16380 bytes, 8193 chars.
beg of stream3 is abcҖҖҖҖҖҖҖ
end of stream3 is ҖҖҖҖҖҖҖxyz
Test 4: の
size of string4 is 24567 bytes, 8193 chars.
size of stream4 is 24567 bytes, 8193 chars.
beg of stream4 is abcののののののの
end of stream4 is のののののののxyz
+82 -3
View File
@@ -573,7 +573,18 @@ PHP_METHOD(Phar, webPhar)
}
/* retrieve requested file within phar */
if (!(SG(request_info).request_method && SG(request_info).request_uri && (!strcmp(SG(request_info).request_method, "GET") || !strcmp(SG(request_info).request_method, "POST")))) {
if (!(SG(request_info).request_method
&& SG(request_info).request_uri
&& (!strcmp(SG(request_info).request_method, "GET")
|| !strcmp(SG(request_info).request_method, "POST")
|| !strcmp(SG(request_info).request_method, "DELETE")
|| !strcmp(SG(request_info).request_method, "HEAD")
|| !strcmp(SG(request_info).request_method, "OPTIONS")
|| !strcmp(SG(request_info).request_method, "PATCH")
|| !strcmp(SG(request_info).request_method, "PUT")
)
)
) {
return;
}
@@ -5090,7 +5101,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_phar___construct, 0, 0, 1)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, flags)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, fileformat)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_phar_createDS, 0, 0, 0)
@@ -5300,6 +5310,75 @@ zend_function_entry php_archive_methods[] = {
PHP_FE_END
};
ZEND_BEGIN_ARG_INFO_EX(arginfo_data___construct, 0, 0, 1)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, flags)
ZEND_ARG_INFO(0, alias)
ZEND_ARG_INFO(0, fileformat)
ZEND_END_ARG_INFO()
zend_function_entry php_data_methods[] = {
PHP_ME(Phar, __construct, arginfo_data___construct, ZEND_ACC_PUBLIC)
PHP_ME(Phar, __destruct, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, addEmptyDir, arginfo_phar_emptydir, ZEND_ACC_PUBLIC)
PHP_ME(Phar, addFile, arginfo_phar_addfile, ZEND_ACC_PUBLIC)
PHP_ME(Phar, addFromString, arginfo_phar_fromstring, ZEND_ACC_PUBLIC)
PHP_ME(Phar, buildFromDirectory, arginfo_phar_fromdir, ZEND_ACC_PUBLIC)
PHP_ME(Phar, buildFromIterator, arginfo_phar_build, ZEND_ACC_PUBLIC)
PHP_ME(Phar, compressFiles, arginfo_phar_comp, ZEND_ACC_PUBLIC)
PHP_ME(Phar, decompressFiles, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, compress, arginfo_phar_comps, ZEND_ACC_PUBLIC)
PHP_ME(Phar, decompress, arginfo_phar_decomp, ZEND_ACC_PUBLIC)
PHP_ME(Phar, convertToExecutable, arginfo_phar_conv, ZEND_ACC_PUBLIC)
PHP_ME(Phar, convertToData, arginfo_phar_conv, ZEND_ACC_PUBLIC)
PHP_ME(Phar, copy, arginfo_phar_copy, ZEND_ACC_PUBLIC)
PHP_ME(Phar, count, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, delete, arginfo_phar_delete, ZEND_ACC_PUBLIC)
PHP_ME(Phar, delMetadata, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, extractTo, arginfo_phar_extract, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getAlias, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getPath, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getMetadata, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getModified, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getSignature, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getStub, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, getVersion, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, hasMetadata, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, isBuffering, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, isCompressed, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, isFileFormat, arginfo_phar_isff, ZEND_ACC_PUBLIC)
PHP_ME(Phar, isWritable, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, offsetExists, arginfo_phar_offsetExists, ZEND_ACC_PUBLIC)
PHP_ME(Phar, offsetGet, arginfo_phar_offsetExists, ZEND_ACC_PUBLIC)
PHP_ME(Phar, offsetSet, arginfo_phar_offsetSet, ZEND_ACC_PUBLIC)
PHP_ME(Phar, offsetUnset, arginfo_phar_offsetExists, ZEND_ACC_PUBLIC)
PHP_ME(Phar, setAlias, arginfo_phar_setAlias, ZEND_ACC_PUBLIC)
PHP_ME(Phar, setDefaultStub, arginfo_phar_createDS, ZEND_ACC_PUBLIC)
PHP_ME(Phar, setMetadata, arginfo_phar_setMetadata, ZEND_ACC_PUBLIC)
PHP_ME(Phar, setSignatureAlgorithm, arginfo_phar_setSigAlgo, ZEND_ACC_PUBLIC)
PHP_ME(Phar, setStub, arginfo_phar_setStub, ZEND_ACC_PUBLIC)
PHP_ME(Phar, startBuffering, arginfo_phar__void, ZEND_ACC_PUBLIC)
PHP_ME(Phar, stopBuffering, arginfo_phar__void, ZEND_ACC_PUBLIC)
/* static member functions */
PHP_ME(Phar, apiVersion, arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, canCompress, arginfo_phar_cancompress, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, canWrite, arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, createDefaultStub, arginfo_phar_createDS, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, getSupportedCompression,arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, getSupportedSignatures,arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, interceptFileFuncs, arginfo_phar__void, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, isValidPharFilename, arginfo_phar_isvalidpharfilename, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, loadPhar, arginfo_phar_loadPhar, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, mapPhar, arginfo_phar_mapPhar, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, running, arginfo_phar_running, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, mount, arginfo_phar_mount, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, mungServer, arginfo_phar_mungServer, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, unlinkArchive, arginfo_phar_ua, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_ME(Phar, webPhar, arginfo_phar_webPhar, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
PHP_FE_END
};
ZEND_BEGIN_ARG_INFO_EX(arginfo_entry___construct, 0, 0, 1)
ZEND_ARG_INFO(0, filename)
ZEND_END_ARG_INFO()
@@ -5347,7 +5426,7 @@ void phar_object_init(void) /* {{{ */
zend_class_implements(phar_ce_archive, 2, spl_ce_Countable, zend_ce_arrayaccess);
INIT_CLASS_ENTRY(ce, "PharData", php_archive_methods);
INIT_CLASS_ENTRY(ce, "PharData", php_data_methods);
phar_ce_data = zend_register_internal_class_ex(&ce, spl_ce_RecursiveDirectoryIterator);
zend_class_implements(phar_ce_data, 2, spl_ce_Countable, zend_ce_arrayaccess);
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Phar: bug #74386: Phar::__construct(): wrong number of parameters by reflection
--SKIPIF--
<?php if (!extension_loaded("phar") || !extension_loaded('reflection')) die("skip"); ?>
--FILE--
<?php
$r = new ReflectionMethod(Phar::class, '__construct');
var_dump($r->getNumberOfRequiredParameters());
var_dump($r->getNumberOfParameters());
$r = new ReflectionMethod(PharData::class, '__construct');
var_dump($r->getNumberOfRequiredParameters());
var_dump($r->getNumberOfParameters());
?>
===DONE===
--EXPECT--
int(1)
int(3)
int(1)
int(4)
===DONE===
+1 -1
View File
@@ -214,7 +214,7 @@ PHP_MINFO_FUNCTION(readline)
Reads a line */
PHP_FUNCTION(readline)
{
char *prompt = "";
char *prompt = NULL;
size_t prompt_len;
char *result;
+7 -1
View File
@@ -468,6 +468,9 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
ZEND_HASH_FOREACH_STR_KEY_PTR(&ce->constants_table, key, c) {
_class_const_string(str, ZSTR_VAL(key), c, ZSTR_VAL(sub_indent.buf));
if (UNEXPECTED(EG(exception))) {
return;
}
} ZEND_HASH_FOREACH_END();
}
string_printf(str, "%s }\n", indent);
@@ -732,7 +735,10 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg
string_write(str, " = ", sizeof(" = ")-1);
ZVAL_DUP(&zv, RT_CONSTANT(&fptr->op_array, precv->op2));
zval_update_constant_ex(&zv, fptr->common.scope);
if (UNEXPECTED(zval_update_constant_ex(&zv, fptr->common.scope) == FAILURE)) {
zval_ptr_dtor(&zv);
return;
}
if (Z_TYPE(zv) == IS_TRUE) {
string_write(str, "true", sizeof("true")-1);
} else if (Z_TYPE(zv) == IS_FALSE) {
@@ -11,6 +11,7 @@ $functions = [
function(): bool {},
function(): array {},
function(): callable {},
function(): iterable {},
function(): StdClass {}
];
@@ -28,4 +29,5 @@ string(6) "string"
string(4) "bool"
string(5) "array"
string(8) "callable"
string(8) "iterable"
string(8) "StdClass"
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #74673 (Segfault when cast Reflection object to string with undefined constant)
--FILE--
<?php
set_error_handler(function() {
throw new Exception();
});
class A
{
public function method($test = PHP_SELF + 1)
{
}
}
$class = new ReflectionClass('A');
echo $class;
?>
--EXPECTF--
Fatal error: Method ReflectionClass::__toString() must not throw an exception, caught Exception: in %sbug74673.php on line %d
+5 -1
View File
@@ -2440,6 +2440,10 @@ ZEND_BEGIN_ARG_INFO(arginfo_session_class_updateTimestamp, 0)
ZEND_ARG_INFO(0, key)
ZEND_ARG_INFO(0, val)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_session_start, 0, 0, 0)
ZEND_ARG_INFO(0, options) /* array */
ZEND_END_ARG_INFO()
/* }}} */
/* {{{ session_functions[]
@@ -2453,7 +2457,7 @@ static const zend_function_entry session_functions[] = {
PHP_FE(session_regenerate_id, arginfo_session_regenerate_id)
PHP_FE(session_decode, arginfo_session_decode)
PHP_FE(session_encode, arginfo_session_void)
PHP_FE(session_start, arginfo_session_void)
PHP_FE(session_start, arginfo_session_start)
PHP_FE(session_destroy, arginfo_session_void)
PHP_FE(session_unset, arginfo_session_void)
PHP_FE(session_gc, arginfo_session_void)
+1
View File
@@ -9,6 +9,7 @@ session.name=sid
session.save_path=/tmp
session.gc_probability=1
session.gc_divisor=1
session.save_handler=files
--FILE--
<?php
error_reporting(E_ALL);
+1
View File
@@ -3,6 +3,7 @@ Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write())
--INI--
session.save_path=
session.name=PHPSESSID
session.save_handler=files
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
+1
View File
@@ -3,6 +3,7 @@ Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write())
--INI--
session.save_path=
session.name=PHPSESSID
session.save_handler=files
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
+1
View File
@@ -3,6 +3,7 @@ Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write())
--INI--
session.save_path=
session.name=PHPSESSID
session.save_handler=files
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
+1
View File
@@ -3,6 +3,7 @@ Bug #60634 (Segmentation fault when trying to die() in SessionHandler::write())
--INI--
session.save_path=
session.name=PHPSESSID
session.save_handler=files
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
Loaded 100 of 166 files, more files were not shown because too many files have changed in this diff. Show more