Compare commits

...
Author SHA1 Message Date
Anatol Belski fbe2490ce0 set versions 2017-05-23 12:40:44 +02:00
Anatol Belski c4ae856912 move to the next sdk version for AppVeyor 2017-05-20 13:48:35 +02:00
Anatol Belski 464c1639ae follow up fix on bug #74022 2017-05-18 12:03:13 +02:00
Xinchen Hui 0954ea8d6d Added cleanup 2017-05-17 23:24:58 +08:00
Xinchen Hui ef09bc0645 Added test for bug #74600 2017-05-17 23:21:18 +08:00
Xinchen Hui e347b2ded6 Added test for bug #74596 2017-05-17 22:42:18 +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
Steve Walk d74fbfb38f variation of icu libraries causes failure 2017-05-16 12:46:27 +02: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 777929b1ae switch to Postgres 9.6 for appveyor 2017-05-15 17:47:41 +02:00
Sara Golemon b8e0351978 Remove typo from test header 2017-05-10 16:50:19 -07: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 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 1a06fae543 sync bin sdk version 2017-05-08 19:38: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 b966a8b5fa Fixed another potential dangling pointer 2017-05-08 11:36:07 +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 5c957b502e [ci skip] update NEWS 2017-05-07 13:04:21 +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 622dc2a611 [ci skip] update NEWS 2017-05-02 14:53:32 +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 36c53036e7 [ci skip] update NEWS 2017-05-02 12:38:04 +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
Fabien Villepinte 4c0e50c88a Fix bug #74457 Wrong reflection on XMLReader::expand 2017-05-02 06:24:46 +01:00
Fabien Villepinte f50df1d0e3 Fix bug #74468 wrong reflection on Collator::sortWithSortKeys 2017-05-02 06:20:40 +01: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 1967950dc3 Fix typo in SplFixedArray has_dimension implementation 2017-05-01 12:15:26 +02: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 a0b9554f94 Fix possible memory leak in openssl_encrypt and openssl_decrypt 2017-04-27 15:44:26 +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 e67096dbbb [ci skip] update NEWS 2017-04-27 11:35:00 +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 36301bd615 sync bin sdk version 2017-04-26 17:04:29 +02: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 f639b64dca rely on bundle config, instead of system one 2017-04-26 14:41:40 +02:00
Anatol Belski 8cfaea656c skip the test on OpenSSL < 1.1 for now 2017-04-26 14:39:03 +02:00
Anatol Belski 53a702c020 move next 2017-04-25 14:06:17 +02:00
Anatol Belski 6aac86ec29 [ci skip] update NEWS 2017-04-25 13:59:20 +02:00
Sara Golemon cda7dcf4ca Follow up patch regarding bug #74216, see bug #74429
While the case in bug #74429 is not documented and is only worky due to
an implementation bug, the strength seems to breach some real world
apps. Given this patch doesn't impact the initial security fix for
bug #74216, it is reasonable to let the apps keep working. As mentioned
in the ticket, this behavior is a subject to change in future versions
and should not be abused.
2017-04-25 12:52:48 +02:00
Anatol Belski 6afcd6c86a don't backup older deps after upgrades 2017-04-24 22:10:32 +02:00
Anatol Belski e969966468 update SDK version for AppVeyor 2017-04-24 22:08:45 +02:00
Jakub Zelenka 9fa347997a Fix bug #73833 (null character not allowed in openssl_pkey_get_private) 2017-04-24 17:11:36 +01:00
Anatol Belski f7b8322b14 Support also no,shared configure arg vals by default
This indirectly fixes bug #74398 where --with-extname is expected to be
configured shared with our default dependency package. With a non
default deps, it still can be enforced --with-extname=static
2017-04-24 15:46:22 +02:00
Jakub Zelenka dd36541f2c Add missing NEWS entries for 7.0.19 2017-04-23 21:03:35 +01:00
Anatol Belski f3c4e2f5bf extend zlib export required for the recent libpng 2017-04-23 21:33:14 +02:00
Jakub Zelenka 366b1640d0 Fix bug #73711 (Segfault in openssl_pkey_new when generating DSA or DH key) 2017-04-23 20:30:14 +01:00
Anatol Belski 5d1fd66faf [ci skip] update NEWS 2017-04-22 22:39:59 +02:00
Anton Serbulov 793a8bd886 #74337 pointer returned by php_stream_fopen_tmpfile not validated in memory.c 2017-04-22 21:56:37 +02:00
Steve Walk 9b7f13cb1b Avoid exact floating point comparison 2017-04-20 06:42:20 +01:00
Alexander Ilyin 464742bd2a Update php_network.h
```
In file included from /usr/local/include/php/main/php_network.h:124:0,
                 from /var/www/html/php-ext-handlersocketi-0.0.1/hs_response.c:3:
/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Wcpp]
 #warning redirecting incorrect #include <sys/poll.h> to <poll.h>
  ^
```
2017-04-20 06:39:14 +01:00
Michael Heimpold 32c5b8efd6 ext/gettext: respect passed in library directory for all checks
A directory given to configure by --with-gettext=dir is only
used within the very first AC_CHECK_LIB. This is because the
temporary modified LDFLAGS variable is reset too early.

This results in functions not detected properly.

The original issue and patch was reported for OpenWrt/LEDE
distribution by @Dimazhan at:
https://github.com/openwrt/packages/issues/4250

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
2017-04-17 08:11:40 +01:00
Craig Duncan 618d97962a Fixed bug #74080 Add datetime constant for RFC7231 2017-04-17 08:08:54 +01:00
Fabien Villepinte 7dc6b04f45 Fixed bug #74439 Wrong reflection on the Locale methods 2017-04-17 07:56:47 +01:00
Anatol Belski ce330ad8aa [ci skip] update NEWS 2017-04-16 14:54:37 +02:00
Anatol Belski ca543ff01c improve/fix error handling
GetLastError() should not be called, if the function didn't fail.
2017-04-15 19:32:04 +02:00
Anatol Belski 9719621e07 fix error handling 2017-04-15 18:19:33 +02:00
Nikita Popov e433c23b96 Improve accuracy of opline lineno information
If compile_var() was used instead of compile_expr() we did not
update the current lineno.
2017-04-15 18:15:24 +02:00
Nikita Popov 0beccc51f1 Fix compact_literals of INIT_METHOD_CALL with CONST op1 2017-04-15 12:35:09 +02:00
Johannes Schlüter 35a28fac51 Add support for MySQL 8's Unicode types 2017-04-14 16:30:10 +02:00
Fabien Villepinte f05d74feb8 Fixed bug #74433 Wrong reflection on the Normalizer methods 2017-04-13 13:21:05 +01:00
Remi Collet da41afeb48 NEWS 2017-04-13 07:10:37 +02:00
Fabien Villepinte bc4bb7882b Fixed bug #74416 Wrong reflection on DOMNode::cloneNode 2017-04-13 07:07:24 +02:00
Christopher Jones f4a41fe750 Fixed uninitialized data causing random crash (Dmitry) 2017-04-12 14:02:46 +10:00
Christopher Jones 28ddfbb892 Add missing NEWS 2017-04-12 13:23:19 +10:00
Anatol Belski 8bba2df2eb Fix misleading typo in identifiers 2017-04-11 13:48:04 +02:00
Joe Watkins b74b325aea fixed bug #74413 wrong reflection on SQLite3::enableExceptions 2017-04-11 12:14:25 +01:00
Xinchen Hui eb03f16442 Fixed bug #74408 (Endless loop bypassing execution time limit) 2017-04-11 18:46:16 +08:00
Anatol Belski dd17659b86 fix re2c version comparison 2017-04-11 11:03:24 +02:00
Matt Ficken 76c9b58431 Fix #74410 by calling WaitForMultipleObjects() instead of
MsgWaitForMultipleObjects()
2017-04-11 01:54:57 -07:00
Sebastian Bergmann 7cdf520319 Fix bug #74409 2017-04-11 08:27:17 +02:00
Nikita Popov 6e23f2bceb Forgot to commit test file... 2017-04-10 22:26:14 +02:00
Nikita Popov 6f950e83eb Fix JMPZ+JMP => NOP+JMP optimization 2017-04-10 22:09:34 +02:00
Joe Watkins 8c53c346d4 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fixed bug #74402 (segfault on random_bytes, bin2hex, openssl_seal)
2017-04-10 12:51:17 +01:00
Joe Watkins d9e2f80375 Fixed bug #74404 (wrong reflection on DateTimeZone::getTransitions) 2017-04-10 12:48:51 +01:00
Xinchen Hui 42e576ace2 Fixed bug #74402 (segfault on random_bytes, bin2hex, openssl_seal) 2017-04-10 19:02:50 +08:00
Joe Watkins e642375764 Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Fixed condition check
  Fixed issue #2466 Invalid integer constant expression error in php.h
2017-04-10 08:07:24 +01:00
Joe Watkins 60b68f19f0 Fixed bug #74400 (phpdbg comparing socket function to int) 2017-04-10 08:05:31 +01:00
Xinchen Hui 4bebcb84ad Fixed condition check 2017-04-10 14:47:24 +08:00
Xinchen Hui 66411ee62e Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  fix news
  Fix of Bug #74383: Wrong reflection on Phar::running
2017-04-10 14:41:29 +08:00
Xinchen Hui d2923ec1e5 Fixed issue #2466 Invalid integer constant expression error in php.h 2017-04-10 14:40:44 +08:00
Joe Watkins a93832f414 fix news 2017-04-10 06:44:20 +01:00
Mitch Hagstrand d9a05807d2 Fix of Bug #74383: Wrong reflection on Phar::running 2017-04-10 06:32:15 +01:00
Xinchen Hui 9c7cb2cdcd Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Add NEWS
  Resolve bug #74188 (undefined statics raising with ?? operator)
  Fixed bug #72071: Prevent Max-Age from being negative
  Update NEWS with OpenSSL 1.1.0 support info
  Add OpenSSL 1.1.0 support to PHP 7.0
2017-04-10 11:49:44 +08:00
Xinchen Hui 341ff7119f Fixed bug #74379 (syntax error compile error in libmagic/apprentice.c) 2017-04-10 11:44:41 +08:00
Xinchen Hui a87ee7c57b Missed NEWS 2017-04-10 11:22:08 +08:00
Nikita Popov 75b83ec2fd Add NEWS 2017-04-09 15:52:37 +02:00
Thomas Punt 744c4a5592 Resolve bug #74188 (undefined statics raising with ?? operator) 2017-04-09 15:29:31 +02:00
Craig Duncan ba6561d3cc Fixed bug #72071: Prevent Max-Age from being negative 2017-04-09 13:14:40 +02:00
Jakub Zelenka 948ad747d7 Update NEWS with OpenSSL 1.1.0 support info 2017-04-07 19:27:25 +01:00
Jakub Zelenka cdc33251d2 Add OpenSSL 1.1.0 support to PHP 7.0 2017-04-07 19:21:33 +01:00
Yussuf Khalil 27120d4412 Fix invalid free of persistent results on error/connection loss in mysqlnd (bug 74376) 2017-04-05 20:57:03 +02:00
Anatol Belski 4ca3468e78 Revert "extend skip section"
This reverts commit 5136048064.

This is not needed anymore wrt dst handling fix
2017-04-04 16:21:23 +02:00
Anatol Belski feeb35e438 fix possible out of bounds buffer access 2017-04-03 15:20:32 +02:00
Martin Hujer 670041b60e Fix opcache.max_accelerated_files doc in php.ini
As stated in docs: https://secure.php.net/manual/en/opcache.configuration.php#ini.opcache.max-accelerated-files, the maximum is now 1000000
> The maximum value is 100000 in PHP < 5.5.6, and 1000000 in later versions.
2017-04-02 01:05:26 +02:00
Moritz Fain 46d286574b Fixed bug #74341
Added support for ASN.1 UTCTime without seconds part (being 11 characters
long instead of 13).

Additionally, fixed incorrect handling of DST on systems without gmtoff.
2017-04-02 01:04:32 +02:00
Anatol Belski e0102f81aa update sdk version for appveyor 2017-03-31 01:42:46 +02:00
Joe Watkins ef3140e544 fix bug #74343 compile fails on solaris 11 with system libgd 2017-03-30 16:27:40 +01:00
Nikita Popov d6f70f0ee3 Disable block pass for large functions
(Backport of 7ea261685f to 7.0.)
2017-03-28 22:07:37 +02:00
Anatol Belski 5c93a31804 update NEWS 2017-03-28 13:12:27 +02:00
Anatol Belski ef8632c9dc Revert "Fixed bug #61471"
This reverts commit 80c8d84af3.
2017-03-28 13:06:38 +02:00
Anatol Belski ddad991c18 prepare next 2017-03-28 11:49:04 +02:00
Anatol Belski 5b12d08e1f update NEWS 2017-03-28 11:43:02 +02:00
Anatol Belski ee8b5de5a0 deps updated, cherry-pick 88642decf9 2017-03-27 19:38:20 +02:00
Anatol Belski 6da475367a add test for bug #74230 2017-03-27 19:33:51 +02:00
Derick Rethans 1f8fc0fb56 Forgot to update the output in the test too 2017-03-27 18:01:22 +01:00
Anatol Belski 867c29caf0 always use staging deps for CI, that's what we have a CI for as well 2017-03-27 18:07:16 +02:00
Derick Rethans eb5d4bcd4f Fixed test for #33415 due to data fixes. 2017-03-27 11:28:16 +01:00
Derick Rethans eb13003f6c Updated to version 2017.2 (2017b) 2017-03-24 12:25:25 +00:00
Nikita Popov d719b46222 Fix sequencing UB 2017-03-23 22:48:45 +01:00
Nikita Popov f5951cc81b Fix lineno for AST_ZVAL nodes 2017-03-23 22:48:41 +01:00
Sara Golemon 0fb640c717 Fix bug where yield from is captured too greedily
In the following piece of code:

```php
function from1234($x) {
  return $x;
}
function foo($x) {
  yield from1234($x);
}
```

The statement inside foo is taken as `yield from` `1234($x)`
which is neither the intent, nor even legal syntax for an fcall.

Do a lookahead for breaking non-label characters after the
`yield from` and only accept it if they occur.
2017-03-23 13:31:06 -07:00
Dmitry Stogov 1517fdb36c Fixed uninitialized data 2017-03-23 18:59:27 +03:00
Anatol Belski 1dbef2e27a adjust deps dir naming scheme
not principal, just to have it same way as everywhere
2017-03-23 13:00:14 +01:00
Anatol Belski bc2b500d3e explicitly ignore php.ini for proc open tests
In some cases, when an environment is unclean, tests might get stuck fe
when some incorrect ini file is loaded. As the test depends on the core
only, it is safer to explicitly ignore the ini. Any ini can be passed in
the cmd itself, if needed.
2017-03-21 12:39:40 +01:00
Jakub Zelenka 6d066dc421 Lower timeout in test for but #72333 2017-03-20 16:07:12 +00:00
Nikita Popov 2e83082605 Fix bug #74265 2017-03-17 20:19:40 +01:00
Jakub Zelenka df135ffa7a Make test 002 for bug #65538 not to use https in cafile 2017-03-17 19:07:32 +00:00
Jakub Zelenka 53e2c9158d Consume data by server in test for bug #72333
Client should be able to write more data and prevent time out
2017-03-17 18:11:50 +00:00
Nikita Popov 183cd048f1 Fix AST start lineno for list nodes
If the node is initialized with children, check if a child has a
lower start lineno, similar to what we do for fixed-sized nodes
as well.
2017-03-17 13:35:24 +01:00
Jakub Zelenka 0c8ad36d92 Make test for bug #72333 a bit more reliable 2017-03-16 18:11:56 +00:00
Adam Saponara 98f4ce9363 Return FALSE if error_log fails to write all bytes 2017-03-16 12:56:36 +01:00
Matt Bonneau 7fba8bda4c Fixed bug #74240 (deflate_add can allocate too much memory) 2017-03-15 00:08:32 +01:00
Bob Weinand 8be63ce0e2 Fix stream context changes leaking into copies of previous context 2017-03-14 22:15:41 +01:00
Jakub Zelenka b9d3dbc84e Merge branch 'bug72333' into PHP-7.0 2017-03-14 18:43:39 +00:00
Jakub Zelenka 960e5cde02 Replace NEWS entry for #74159 with #72333
The #74159 is duplicate
2017-03-14 18:41:23 +00:00
Jakub Zelenka ba70478a21 Skip bug74159 test for OpenSSL lower than 1.0.1 2017-03-14 18:13:57 +00:00
Jakub Zelenka 8e5d080d54 Tidy up test for bug72333 2017-03-14 18:13:57 +00:00
Jakub Zelenka f0e67d1a56 Speed up test for bug72333
It reliably fails without the xp_ssl.c so it is good with smaller usleep
2017-03-14 18:13:57 +00:00
Jakub Zelenka 411f4b1b6f Fix indent and add comment 2017-03-14 18:13:57 +00:00
Jakub Zelenka 760ff21bf3 Tidy up setting of SSL_MODE_RELEASE_BUFFERS 2017-03-14 18:13:57 +00:00
Jakub Zelenka 53cc72ef86 Remove extra SSL mode settings 2017-03-14 18:13:57 +00:00
Jakub Zelenka 17e9fc9bfe Fix bug #72333 (fwrite() on non-blocking SSL sockets does not work) 2017-03-14 18:13:57 +00:00
Anatol Belski 8e45583006 update binary sdk tools version for appveyor 2017-03-13 12:31:31 +01:00
Nikita Popov 29ee3e3c49 Fixed bug #73960 2017-03-10 18:20:32 +01:00
Xinchen Hui c398198c0a Fixed bug #74218 (ArrayIterator error message is confusing) 2017-03-10 15:15:31 +08:00
Sara Golemon 9b16d4c999 Add NEWS entry for bab0b99f 2017-03-09 11:56:06 -08:00
Nikita Popov 177f87cf05 Fixed bug #73370
If len=0 malloc() is allowed to return NULL.
2017-03-09 20:47:06 +01:00
Thomas Orozco 247ce052cd Fixed bug #71003: Add PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT 2017-03-09 17:31:21 +01:00
mcq8 b224e74267 Fixed bug #72096 Swatch time value incorrect for dates before 1970 2017-03-09 16:44:02 +01:00
Sara Golemon bab0b99f37 Detect invalid port in xp_socket parse ip address
For historical reasons, fsockopen() accepts the port and hostname
separately: fsockopen('127.0.0.1', 80)

However, with the introdcution of stream transports in PHP 4.3,
it became possible to include the port in the hostname specifier:

fsockopen('127.0.0.1:80')
Or more formally: fsockopen('tcp://127.0.0.1:80')

Confusing results when these two forms are combined, however.
fsockopen('127.0.0.1:80', 443) results in fsockopen() attempting
to connect to '127.0.0.1:80:443' which any reasonable stack would
consider invalid.

Unfortunately, PHP parses the address looking for the first colon
(with special handling for IPv6, don't worry) and calls atoi()
from there.  atoi() in turn, simply stops parsing at the first
non-numeric character and returns the value so far.

The end result is that the explicitly supplied port is treated
as ignored garbage, rather than producing an error.

This diff replaces atoi() with strtol() and inspects the
stop character.  If additional "garbage" of any kind is found,
it fails and returns an error.
2017-03-07 12:10:53 -08:00
Nikita Popov 549a30d2cd Fix out of bounds access in gc_find_additional_buffer() 2017-03-07 13:16:06 +01:00
Dmitry Stogov 648b756f35 Fixed file-cache (Zend/tests/unused_shared_static_variables.phpt) 2017-03-03 16:10:46 +03:00
Anatol Belski c082c92b7e sync NEWS for bug #74159 2017-03-02 20:45:15 +01:00
Anatol Belski 18f7e26257 improve signal globals consistency check for TS
Seems when we receive TERM, TLS is destroyed completely. In that case,
not only signal globals, but the entire globals array doesn't exist
anymore.
2017-03-02 20:27:27 +01:00
Anatol Belski c7b2c698d0 do not try to handle signals, when globals are inconsistent 2017-03-02 16:40:38 +01:00
somedaysummer fab5ce347c PHP bug #74004
Fix for DOMDocument loadHTML and loadHTMLFile ignore LIBXML_NOWARNING
and LIBXML_NOERROR flags.
2017-03-02 12:35:42 +01:00
Derick Rethans cf60f26da6 Fixed tests after tzdb removed abbreviations 2017-03-02 11:28:02 +00:00
Derick Rethans 61e9b7354f Make sure we anchor this test to February 2017-03-02 11:27:44 +00:00
Mitch Hagstrand 29333550d2 Fix bug73858.phpt to work in months without 31 days
Used hardcoded months in bug73858.phpt rather than the current and previous
month.
2017-03-02 12:13:06 +01:00
Christopher Jones e80ea04c79 Fixed bug #54379 (PDO_OCI: UTF-8 output gets truncated)
This was a modification of an incomplete PR #2276.
2017-03-02 15:28:01 +11:00
Derick Rethans dfcb11d7d1 Updated to version 2017.1 (2017a) 2017-03-01 20:07:51 +00:00
Remi Collet 53a08fd07d make type consistent with glob_t.gl_pathc 2017-03-01 17:01:58 +01:00
Sara Golemon 868930e079 Fix potential crash when setting invalid declare value
Using a non-literal expression in a declare value can cause the
compiler to crash trying to turn that AST node into a usable zval.

There was an existing test for such values using 'encoding',
but that didn't crash because it's handled by the lexer
rather than being compiled.

Trying to use a non-literal with ticks reproduces the crash.
2017-02-28 17:08:23 -08:00
Anatol Belski 21a05b0418 prepare next 2017-02-28 09:46:11 +01:00
Joe Watkins c564924d31 Revert "fix crash in phpdbg shutdown process when opcache is loaded"
This reverts commit 008fb28eaf.
2017-02-27 19:21:10 +00:00
Joe Watkins 008fb28eaf fix crash in phpdbg shutdown process when opcache is loaded 2017-02-27 17:54:48 +00:00
Nikita Popov bbfa1b6419 Improve fix for bug #73807
At least on some architectures memmove() on FreeBSD does not
short-curcuit if src==dst. Check for it explicitly to avoid
quadratic copying.
2017-02-25 12:55:14 +01:00
Grundik eac8166bd4 Fix bug #73127
gost-crypto hash was incorrect if input data contained long 0xFF
sequence, due to a carry-propagation bug.
2017-02-24 23:20:49 +01:00
Anatol Belski 9450e23b32 Support run or test target invoked within debugger
Useful, as it gets all the environment produced by the makefile. For the
test target, it might make sense to have the child process debug plugin
for VS installed.
2017-02-24 19:37:16 +01:00
Aaron Piotrowski ff8a6b1232 Update test for bug #74159 2017-02-23 22:24:59 -06:00
Aaron Piotrowski cc10515056 Update NEWS 2017-02-23 21:10:14 -06:00
Aaron Piotrowski e9873d9853 Fix bug #74159
Thanks to @brzuchal for the patch to xp_ssl.c and @DaveRandom for helping debug the problem.
2017-02-23 20:59:43 -06:00
Xinchen Hui 330a7b62c3 Fixed bug #74152 (if statement says true to a null variable) 2017-02-23 12:33:17 +08:00
Xinchen Hui 1d4eead995 Fixed bug #74148 (ReflectionFunction incorrectly reports the number of arguments) 2017-02-23 11:02:23 +08:00
Remi Collet 015a80ef7b report about OpenSSL 1.1 not supported during configure 2017-02-22 08:39:07 +01:00
Coenraad Loubser 9eaf551c86 pull-request/2393:
stop make install from clobbering default dot d configuration
2017-02-22 06:47:23 +00:00
Dmitry Stogov 593a4d8fe9 too many dashes 2017-02-21 10:47:48 +03:00
Dmitry Stogov bd7e5c1548 Increase WSDL cache version (7.0 wsdl cache is incomatible with PHP-5)
Include WSDL cache version number into file name
2017-02-21 10:41:20 +03:00
Remi Collet c836ad1c7e fix test for libzip 1.2.0 2017-02-19 17:02:00 +01:00
Anatol Belski 1623ef10c9 initialize valid_symbol_table, important for the main thread
to prevent php_errormsg population on invalid symlol_table
2017-02-18 17:58:17 +01:00
Benjamin Robin 513582814b Fixed bug #74105
If getrandom syscall is unavailable (ENOSYS), try to fallback on
/dev/urandom.
2017-02-17 18:42:35 +01:00
Ondřej Surý 61e59db99d Disable RTLD_DEEPBIND when compiling with AddressSanitizer (-fsanitize=address).
The AddressSanitizer doesn't support RTLD_DEEPBIND resulting in
erratic errors when deinitializing phar module and possibly others.

Clang use __has_feature() macro to indicate compilation with
AddressSanitizer while gcc uses __SANITIZE_ADDRESS__ define.

Fixes bug #73677.
2017-02-16 17:35:29 +01:00
Nikita Popov cf3ef36323 Fix memory errors in url rewriter
Strings aren't terminated here...
2017-02-16 17:24:07 +01:00
Nikita Popov 708973c9bd Fix autoload_func_info destruction
Can't reference the function ptr after the closure has been
destroyed.
2017-02-16 16:59:17 +01:00
Mitch Hagstrand 3b91ed112f Make the ftp and stream tests more reliable.
The tests can sometimes fail because it chooses a passive port for ftp that
is already in use. This makes the test attempt multiple times to find a free
port.
2017-02-16 12:46:55 +01:00
Nikita Popov 5432d6f982 Add json dep to test 2017-02-16 12:45:24 +01:00
Anatol Belski e79754dee3 [ci skip] update NEWS 2017-02-15 16:33:49 +01:00
Anatol Belski 89a5bd6750 Fixed bug #74090 stream_get_contents maxlength>-1 returns empty string 2017-02-15 11:22:47 +01:00
Xinchen Hui 3917350531 Fixed bug #73989 (PHP 7.1 Segfaults within Symfony test suite) 2017-02-13 19:16:17 +08:00
Nikita Popov eb1373e509 Revert "Fixed bug #74035"
This reverts commit 9ffc6ca62f.
2017-02-12 22:02:39 +01:00
Derick Rethans f0519f4837 Upgrade timelib to 2017.01
This fixes:

- Fixed bug #72719 (Relative datetime format ignores weekday on sundays only).
- Fixed bug #73294 (DateTime wrong when date string is negative).
- Fixed bug #73489 (wrong timestamp when call setTimeZone multi times with UTC
  offset).
- Fixed bug #73858 (first/last day of' flag is not being reset).
- Fixed bug #73942 ($date->modify('Friday this week') doesn't return a Friday
  if $date is a Sunday).
- Fixed bug #74057 (wrong day when using "this week" in strtotime).
2017-02-12 20:17:01 +00:00
Xinchen Hui 26fdebc63b Fixed bug #74084 (Out of bound read - zend_mm_alloc_small) 2017-02-12 20:34:08 +08:00
andrewnester 01c1afa79f Fixed bug #74021 2017-02-12 12:48:18 +01:00
Xinchen Hui ee25eb0eae Fixed #73496 (Invalid memory access in zend_inline_hash_func)
no test script is added because it requre too much memory
2017-02-12 18:55:19 +08:00
Nikita Popov 981c58705a run-tests: Exit 1 on BORKED tests 2017-02-12 00:19:36 +01:00
Adam Saponara 7e5cf2aa19 Fixed bug #73118 2017-02-12 00:14:59 +01:00
Denis Yeldandi 9814be4bc2 Fixed bug #69860 2017-02-12 00:06:04 +01:00
Xinchen Hui db7c0badd4 Fixed typo 2017-02-11 00:01:09 +08:00
Xinchen Hui 185304a61e Fixed bug #74019 (Segfault with list) 2017-02-10 14:24:01 +08:00
Zheng SHAO 80c8d84af3 Fixed bug #61471 2017-02-08 01:10:13 +01:00
dreamsxin 7a0adb4cd2 Add #ifndef restrict 2017-02-08 01:00:35 +01:00
Christian Schmidt 714d825b62 Fix detection of isnan and isinf
The isnan() and isinf() are C99 macros not functions.

Also fix is_infinite(-INF) in case isinf is not defined.
2017-02-08 00:53:18 +01:00
Anatol Belski 044dd30440 use some dynamically generated NAN as well 2017-02-07 13:16:30 +01:00
Anatol Belski fd521a22f7 switch to smart str conversion routine to hide exact NAN type
see https://github.com/php/php-src/pull/2356#issuecomment-277564135
2017-02-07 12:01:14 +01:00
Nikita Popov 8a8aa67844 Revert "Fix detection of isnan and isinf"
This reverts commit 9ea0949f43.
2017-02-06 01:45:53 +01:00
Christian Schmidt 9ea0949f43 Fix detection of isnan and isinf
The isnan() and isinf() are C99 macros not functions.

Also fix is_infinite(-INF) in case isinf is not defined.
2017-02-05 18:09:04 +01:00
Andrea Faulds 21d7878690 Fix bug #73954 2017-02-05 01:30:20 +00:00
Nikita Popov dcaf4da8a6 Revert "Merge branch 'pull-request/2344' into PHP-7.0"
This reverts commit 6988d070ea, reversing
changes made to 75ad2b301a.
2017-02-03 18:42:10 +01:00
andrewnester 9ffc6ca62f Fixed bug #74035 2017-02-03 18:29:39 +01:00
Joe Watkins 6988d070ea Merge branch 'pull-request/2344' into PHP-7.0
* pull-request/2344:
  Fixed bug #74004 LIBXML_NOWARNING (etc) ignored by DOMDocument::loadHTML
2017-02-03 06:12:05 +00:00
somedaysummer 4df993d89d Fixed bug #74004 LIBXML_NOWARNING (etc) ignored by DOMDocument::loadHTML 2017-02-03 06:08:42 +00:00
Joe Watkins 75ad2b301a Merge branch 'pull-request/2359' into PHP-7.0
* pull-request/2359:
  increase wait time in timeout_variation_9.phpt by 1 second
2017-02-03 06:00:34 +00:00
Rodrigo Prado 0b56ba51d0 increase wait time in timeout_variation_9.phpt by 1 second 2017-02-03 05:57:26 +00:00
Joe Watkins 25271feeb0 Merge branch 'pull-request/2360' into PHP-7.0
* pull-request/2360:
  increase wait time in timeout_variation_10.phpt by 1 second
2017-02-03 05:54:50 +00:00
Rodrigo Prado 8faf5f979c increase wait time in timeout_variation_10.phpt by 1 second 2017-02-03 05:53:28 +00:00
Mitch Hagstrand dd9cf23457 BUG #73998: Numeric properties are not accessible from get_object_vars 2017-02-02 18:33:10 +01:00
Matěj Humpál acda2563ce Fix bug #74031
Fix incorrect parameter count for imagepng function
2017-02-02 18:13:53 +01:00
Nikita Popov a15bffd105 Fix bug #73807 2017-02-02 18:06:15 +01:00
Anatol Belski 570a273807 [ci skip] update NEWS 2017-02-02 14:19:35 +01:00
Anatol Belski 6fc0ae638a Fixed #74022 PHP Fast CGI crashes when reading from a pfx file. 2017-02-02 12:48:12 +01:00
Anatol Belski 1d7f8eb693 update NEWS 2017-02-02 01:33:41 +01:00
Anatol Belski 74c95fb3fb sync NEWS with the reverted stuff 2017-02-01 20:00:32 +01:00
Anatol Belski 3446e3b749 Revert "fixed bug #50989 (DOM support for LIBXML_NOXMLDECL)"
This reverts commit 2fcf1259c6.
2017-02-01 19:59:24 +01:00
Anatol Belski 69a2e4ece2 Revert "fix BC break introduced by #2346 (sebastianbergmann/phpunit#2454)"
This reverts commit 62938bf088.
2017-02-01 19:59:18 +01:00
Dmitry Stogov 3f89b630b4 typo 2017-02-01 17:36:55 +03:00
Dmitry Stogov 15e9aa1706 fixed macro 2017-02-01 16:05:33 +03:00
Anatol Belski 8dfa428ccd fix possible NULL dereference 2017-02-01 13:43:33 +01:00
Anatol Belski 15404bda13 remove unused var 2017-02-01 12:49:32 +01:00
Anatol Belski 2cd0d8b711 use zend_string API 2017-02-01 12:45:19 +01:00
Anatol Belski ec43a11581 Fixed bug #74005 mail.add_x_header causes RFC-breaking lone line feed 2017-02-01 12:36:14 +01:00
Anatol Belski d9ca5d9637 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  fix test for 32bits (int -> float)
2017-02-01 11:59:44 +01:00
Remi Collet 0e21d8066b fix test for 32bits (int -> float)
(cherry picked from commit 0f1ae93bfa)
2017-02-01 11:49:52 +01:00
Remi Collet aa9742d80d fix test for 32bits (int -> float) 2017-02-01 10:25:30 +01:00
Anatol Belski 163bb87897 add a primitive debug facility to sendmail 2017-01-31 18:25:36 +01:00
Anatol Belski 5b5130c4ff Revert "backport 51e1da6ea1 into 7.0"
This reverts commit 8da8756312.
2017-01-31 14:21:20 +01:00
Anatol Belski 536b3ca1e1 bump versions for next in dev 2017-01-31 11:18:23 +01:00
263 changed files with 8228 additions and 5449 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.0beta1
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.4
# 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
@@ -53,7 +53,7 @@ install-headers:
paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
done; \
$(mkinstalldirs) $$paths && \
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
echo "Installing header files: $(INSTALL_ROOT)$(phpincludedir)/" && \
for i in `echo $(INSTALL_HEADERS)`; do \
if test "$(PHP_PECL_EXTENSION)"; then \
src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
+213 -2
View File
@@ -1,6 +1,218 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2017 PHP 7.0.16
25 May 2017 PHP 7.0.20RC1
- 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)
- 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)
- 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.0.19
- Core:
. Fixed bug #74188 (Null coalescing operator fails for undeclared static
class properties). (tpunt)
. Fixed bug #74408 (Endless loop bypassing execution time limit). (Laruence)
. Fixed bug #74410 (stream_select() is broken on Windows Nanoserver).
(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).
(krakjoe)
. Fixed bug #74080 (add constant for RFC7231 format datetime). (duncan3dc)
- DOM:
. Fixed bug #74416 (Wrong reflection on DOMNode::cloneNode).
(Remi, Fabien Villepinte)
- Fileinfo:
. Fixed bug #74379 (syntax error compile error in libmagic/apprentice.c).
(Laruence)
- GD:
. Fixed bug #74343 (compile fails on solaris 11 with system gd2 library).
(krakjoe)
- intl:
. Fixed bug #74433 (wrong reflection for Normalizer methods). (villfa)
. Fixed bug #74439 (wrong reflection for Locale methods). (villfa)
- MySQLi:
. Fixed bug #74432 (mysqli_connect adding ":3306" to $host if $port parameter
not given). (Anatol)
- MySQLnd:
. Added support for MySQL 8.0 types. (Johannes)
. Fixed bug #74376 (Invalid free of persistent results on error/connection
loss). (Yussuf Khalil)
- OpenSSL:
. Fixed bug #73833 (null character not allowed in openssl_pkey_get_private).
(Jakub Zelenka)
. Fixed bug #73711 (Segfault in openssl_pkey_new when generating DSA or DH
key). (Jakub Zelenka)
. Fixed bug #74341 (openssl_x509_parse fails to parse ASN.1 UTCTime without
seconds). (Moritz Fain)
. Added OpenSSL 1.1.0 support. (Jakub Zelenka)
- phar:
. Fixed bug #74383 (phar method parameters reflection correction).
(mhagstrand)
- Standard:
. Fixed bug #74409 (Reflection information for ini_get_all() is incomplete).
(Sebastian Bergmann)
. Fixed bug #72071 (setcookie allows max-age to be negative). (Craig Duncan)
- Streams:
. Fixed bug #74429 (Remote socket URI with unique persistence identifier
broken). (Sara)
- SQLite3:
. Fixed bug #74413 (incorrect reflection for SQLite3::enableExceptions).
(krakjoe)
13 Apr 2017 PHP 7.0.18
- Core:
. Fixed bug #73370 (falsely exits with "Out of Memory" when using
USE_ZEND_ALLOC=0). (Nikita)
. Fixed bug #73960 (Leak with instance method calling static method with
referenced return). (Nikita)
. Fixed bug #74265 (Build problems after 7.0.17 release: undefined reference
to `isfinite'). (Nikita)
. Fixed bug #74302 (yield fromLABEL is over-greedy). (Sara)
- Apache:
. Reverted patch for bug #61471, fixes bug #74318. (Anatol)
- Date:
. Fixed bug #72096 (Swatch time value incorrect for dates before 1970). (mcq8)
- DOM:
. Fixed bug #74004 (LIBXML_NOWARNING flag ingnored on loadHTML*).
(somedaysummer)
- iconv:
. Fixed bug #74230 (iconv fails to fail on surrogates). (Anatol)
- OCI8:
. Fixed uninitialized data causing random crash. (Dmitry)
- OpenSSL:
. Fixed bug #72333 (fwrite() on non-blocking SSL sockets doesn't work).
(Jakub Zelenka)
- PDO MySQL:
. Fixed bug #71003 (Expose MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT to PDO
interface). (Thomas Orozco)
- Streams:
. Fixed bug #74216 (Correctly fail on invalid IP address ports). (Sara)
- Zlib:
. Fixed bug #74240 (deflate_add can allocate too much memory). (Matt Bonneau)
16 Mar 2017 PHP 7.0.17
- Core:
. Fixed bug #73989 (PHP 7.1 Segfaults within Symfony test suite).
(Dmitry, Laruence)
. Fixed bug #74084 (Out of bound read - zend_mm_alloc_small). (Laruence)
. Fixed bug #73807 (Performance problem with processing large post request).
(Nikita)
. Fixed bug #73998 (array_key_exists fails on arrays created by
get_object_vars). (mhagstrand)
. Fixed bug #73954 (NAN check fails on Alpine Linux with musl). (Andrea)
. Fixed bug #74039 (is_infinite(-INF) returns false). (Christian Schmidt)
. Fixed bug #73677 (Generating phar.phar core dump with gcc ASAN enabled
build). (ondrej)
- Apache:
. Fixed bug #61471 (Incomplete POST does not timeout but is passed to PHP).
(Zheng Shao)
- Date:
. Fixed bug #72719 (Relative datetime format ignores weekday on sundays
only). (Derick)
. Fixed bug #73294 (DateTime wrong when date string is negative). (Derick)
. Fixed bug #73489 (wrong timestamp when call setTimeZone multi times with
UTC offset). (xiami, Derick)
. Fixed bug #73858 (first/last day of' flag is not being reset). (Derick)
. Fixed bug #73942 ($date->modify('Friday this week') doesn't return a Friday
if $date is a Sunday). (Derick)
. Fixed bug #74057 (wrong day when using "this week" in strtotime). (Derick)
- FPM:
. Fixed bug #69860 (php-fpm process accounting is broken with keepalive).
(Denis Yeldandi)
- Hash:
. Fixed bug #73127 (gost-crypto hash incorrect if input data contains long
0xFF sequence). (Grundik)
- GD:
. Fixed bug #74031 (ReflectionFunction for imagepng is missing last two
parameters). (finwe)
- Mysqlnd:
. Fixed bug #74021 (fetch_array broken data. Data more then MEDIUMBLOB).
(Andrew Nester, Nikita)
- Opcache:
. Fixed bug #74152 (if statement says true to a null variable). (Laruence)
. Fixed bug #74019 (Segfault with list). (Laruence)
- OpenSSL:
. Fixed bug #74022 (PHP Fast CGI crashes when reading from a pfx file).
(Anatol)
- PDO_OCI:
. Fixed bug #54379 (PDO_OCI: UTF-8 output gets truncated). (gureedo / Oracle)
- Standard:
. Fixed bug #74148 (ReflectionFunction incorrectly reports the number of
arguments). (Laruence)
. Fixed bug #74005 (mail.add_x_header causes RFC-breaking lone line feed).
(Anatol)
. Fixed bug #73118 (is_callable callable name reports misleading value for
anonymous classes). (Adam Saponara)
. Fixed bug #74105 (PHP on Linux should use /dev/urandom when getrandom is
not available). (Benjamin Robin)
- Streams:
. Fixed bug #73496 (Invalid memory access in zend_inline_hash_func).
(Laruence)
. Fixed bug #74090 (stream_get_contents maxlength>-1 returns empty string).
(Anatol)
16 Feb 2017 PHP 7.0.16
- Core:
. Fixed bug #73916 (zend_print_flat_zval_r doesn't consider reference).
@@ -13,7 +225,6 @@ PHP NEWS
- DOM:
. Fixed bug #54382 (getAttributeNodeNS doesn't get xmlns* attributes).
(aboks)
. Fixed bug #50989 (support for LIBXML_NOXMLDECL). (jhdxr)
- DTrace:
. Fixed bug #73965 (DTrace reported as enabled when disabled). (Remi)
+2 -3
View File
@@ -671,7 +671,6 @@ TSRM_API int shmget(int key, int size, int flags)
TSRM_API void *shmat(int key, const void *shmaddr, int flags)
{
shm_pair *shm = shm_get(key, NULL);
int err;
if (!shm->segment) {
return (void*)-1;
@@ -679,8 +678,8 @@ TSRM_API void *shmat(int key, const void *shmaddr, int flags)
shm->addr = MapViewOfFileEx(shm->segment, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL);
err = GetLastError();
if (err) {
if (NULL == shm->addr) {
int err = GetLastError();
/* Catch more errors */
if (ERROR_NOT_ENOUGH_MEMORY == err) {
_set_errno(ENOMEM);
+1 -1
View File
@@ -100,7 +100,7 @@ AC_FUNC_ALLOCA
AC_CHECK_FUNCS(memcpy strdup getpid kill strtod strtol finite fpclass sigsetjmp)
AC_ZEND_BROKEN_SPRINTF
AC_CHECK_FUNCS(finite isfinite isinf isnan)
AC_CHECK_DECLS([isfinite, isnan, isinf], [], [], [[#include <math.h>]])
ZEND_FP_EXCEPT
+8 -8
View File
@@ -64,33 +64,33 @@ int zend_sprintf(char *buffer, const char *format, ...);
/* To enable the is_nan, is_infinite and is_finite PHP functions */
#ifdef NETWARE
#define HAVE_ISNAN 1
#define HAVE_ISINF 1
#define HAVE_ISFINITE 1
#define HAVE_DECL_ISNAN 1
#define HAVE_DECL_ISINF 1
#define HAVE_DECL_ISFINITE 1
#endif
#ifndef zend_isnan
#ifdef HAVE_ISNAN
#if HAVE_DECL_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#define zend_isnan(a) ((a) != (a))
#endif
#endif
#ifdef HAVE_ISINF
#if HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
#if defined(HAVE_ISFINITE) || defined(isfinite)
#if HAVE_DECL_ISFINITE
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
+1 -1
View File
@@ -79,7 +79,7 @@ Stack trace:
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8, Array)
#1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#3 %sbug72101.php(51): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#3 %sbug72101.php(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#4 %sbug72101.php(72): Mock_MethodCallbackByReference_7b180d26->bar(0, 0, 0)
#5 {main}
thrown in %sbug72101.php on line 61
+23
View File
@@ -0,0 +1,23 @@
--TEST--
Bug #73954 (NAN check fails on Alpine Linux with musl)
--FILE--
<?php
var_dump(NAN);
var_dump(is_nan(NAN));
function takes_int(int $int) {
}
takes_int(log(tan(3.14)));
?>
--EXPECTF--
float(NAN)
bool(true)
Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type integer, float given, called in %s on line 9 and defined in %s:6
Stack trace:
#0 %s(9): takes_int(NAN)
#1 {main}
thrown in %s on line 6
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #73960: Leak with instance method calling static method with referenced return
--FILE--
<?php
$value = 'one';
$array = array($value);
$array = $ref =& $array;
var_dump($array);
?>
--EXPECT--
array(1) {
[0]=>
string(3) "one"
}
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #73989 (PHP 7.1 Segfaults within Symfony test suite)
--FILE--
<?php
class Cycle
{
private $thing;
public function __construct()
{
$obj = $this;
$this->thing = function() use($obj) {};
}
public function __destruct()
{
($this->thing)();
}
}
for ($i = 0; $i < 10000; ++$i) {
$obj = new Cycle();
}
echo "OK\n";
?>
--EXPECT--
OK
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #73998 (array_key_exists fails on arrays created by get_object_vars)
--DESCRIPTION--
Properties of objects with numeric names should be accessible
--FILE--
<?php
$a = new stdClass;
$a->{1234} = "Numeric";
$a->a1234 = "String";
$properties = get_object_vars($a);
var_dump(array_key_exists(1234, $properties));
echo "Value: {$properties[1234]}\n";
?>
--EXPECT--
bool(true)
Value: Numeric
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #74084 (Out of bound read - zend_mm_alloc_small)
--INI--
error_reporting=0
--FILE--
<?php
$$A += $$B->a = &$$C;
unset($$A);
$$A -= $$B->a = &$$C;
unset($$A);
$$A *= $$B->a = &$$C;
unset($$A);
$$A /= $$B->a = &$$C;
unset($$A);
$$A **= $$B->a = &$$C;
var_dump($$A);
?>
--EXPECT--
int(1)
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Fixes bug 74188 (undeclared static variables emit a warning with ?? operator)
--FILE--
<?php
abstract class Test
{
public static function get()
{
static::$a ?? true;
}
}
Test::get();
?>
--EXPECT--
+38
View File
@@ -0,0 +1,38 @@
--TEST--
Bug #74408 (Endless loop bypassing execution time limit)
--INI--
error_reporting = E_ALL | E_DEPRECATED | E_STRICT
--FILE--
<?php
//php.ini: error_reporting = E_ALL | E_DEPRECATED | E_STRICT
class ErrorHandling {
public function error_handler($errno, $errstr, $errfile, $errline) {
$bla = new NonExistingClass2();
}
public function exception_handler(Error $e) {
echo "Caught, exception: " . $e->getMessage();
}
}
set_error_handler('ErrorHandling::error_handler');
set_exception_handler('ErrorHandling::exception_handler');
$blubb = new NonExistingClass();
?>
--EXPECTF--
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in %sbug74408.php on line %d
Deprecated: Non-static method ErrorHandling::error_handler() should not be called statically in Unknown on line 0
Fatal error: Uncaught Error: Class 'NonExistingClass2' not found in %sbug74408.php:%d
Stack trace:
#0 [internal function]: ErrorHandling::error_handler(8192, 'Non-static meth...', '%s', %d, Array)
#1 %sbug74408.php(%d): set_exception_handler('ErrorHandling::...')
#2 {main}
thrown in %sbug74408.php on line %d
+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
+10
View File
@@ -0,0 +1,10 @@
--TEST--
Use of non-literals in declare ticks values crashes compiler
--FILE--
<?php
declare(ticks = UNKNOWN_CONST) {
echo 'Done';
}
--EXPECTF--
Fatal error: declare(ticks) value must be a literal in %sdeclare_006.php on line 2
@@ -0,0 +1,24 @@
--TEST--
yield from parses too greedily
--FILE--
<?php
function from1234($x) {
return $x;
}
function bar() {
yield 24;
}
function foo() {
yield from1234(42);
yield from(bar());
}
foreach (foo() as $value) {
var_dump($value);
}
--EXPECT--
int(42)
int(24)
+1
View File
@@ -567,6 +567,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals) /* {{
#ifdef ZEND_WIN32
zend_get_windows_version_info(&executor_globals->windows_version_info);
#endif
executor_globals->valid_symbol_table = 0;
}
/* }}} */
+2 -2
View File
@@ -2862,7 +2862,7 @@ static ZEND_COLD ZEND_NORETURN void zend_out_of_memory(void)
ZEND_API void * __zend_malloc(size_t len)
{
void *tmp = malloc(len);
if (EXPECTED(tmp)) {
if (EXPECTED(tmp || !len)) {
return tmp;
}
zend_out_of_memory();
@@ -2878,7 +2878,7 @@ ZEND_API void * __zend_calloc(size_t nmemb, size_t len)
ZEND_API void * __zend_realloc(void *p, size_t len)
{
p = realloc(p, len);
if (EXPECTED(p)) {
if (EXPECTED(p || !len)) {
return p;
}
zend_out_of_memory();
+14 -3
View File
@@ -57,17 +57,21 @@ ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
return (zend_ast *) ast;
}
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno) {
zend_ast_zval *ast;
ast = zend_ast_alloc(sizeof(zend_ast_zval));
ast->kind = ZEND_AST_ZVAL;
ast->attr = attr;
ZVAL_COPY_VALUE(&ast->val, zv);
ast->val.u2.lineno = CG(zend_lineno);
ast->val.u2.lineno = lineno;
return (zend_ast *) ast;
}
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
return zend_ast_create_zval_with_lineno(zv, attr, CG(zend_lineno));
}
ZEND_API zend_ast *zend_ast_create_decl(
zend_ast_kind kind, uint32_t flags, uint32_t start_lineno, zend_string *doc_comment,
zend_string *name, zend_ast *child0, zend_ast *child1, zend_ast *child2, zend_ast *child3
@@ -155,7 +159,14 @@ ZEND_API zend_ast *zend_ast_create_list(uint32_t init_children, zend_ast_kind ki
uint32_t i;
va_start(va, kind);
for (i = 0; i < init_children; ++i) {
ast = zend_ast_list_add(ast, va_arg(va, zend_ast *));
zend_ast *child = va_arg(va, zend_ast *);
ast = zend_ast_list_add(ast, child);
if (child != NULL) {
uint32_t lineno = zend_ast_get_lineno(child);
if (lineno < ast->lineno) {
ast->lineno = lineno;
}
}
}
va_end(va);
}
+1
View File
@@ -190,6 +190,7 @@ typedef struct _zend_ast_decl {
typedef void (*zend_ast_process_t)(zend_ast *ast);
extern ZEND_API zend_ast_process_t zend_ast_process;
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno);
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr);
ZEND_API zend_ast *zend_ast_create_ex(zend_ast_kind kind, zend_ast_attr attr, ...);
+14 -2
View File
@@ -1146,6 +1146,8 @@ ZEND_FUNCTION(get_object_vars)
HashTable *properties;
zend_string *key;
zend_object *zobj;
zend_ulong index;
zend_bool fast_copy = 0;
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_OBJECT(obj)
@@ -1164,7 +1166,17 @@ ZEND_FUNCTION(get_object_vars)
zobj = Z_OBJ_P(obj);
if (!zobj->ce->default_properties_count && properties == zobj->properties && !ZEND_HASH_GET_APPLY_COUNT(properties)) {
/* fast copy */
fast_copy = 1;
/* Check if the object has a numeric property, See Bug 73998 */
ZEND_HASH_FOREACH_STR_KEY(properties, key) {
if (key && ZEND_HANDLE_NUMERIC(key, index)) {
fast_copy = 0;
break;
}
} ZEND_HASH_FOREACH_END();
}
if (fast_copy) {
if (EXPECTED(zobj->handlers == &std_object_handlers)) {
if (EXPECTED(!(GC_FLAGS(properties) & IS_ARRAY_IMMUTABLE))) {
GC_REFCOUNT(properties)++;
@@ -1190,7 +1202,7 @@ ZEND_FUNCTION(get_object_vars)
zend_unmangle_property_name_ex(key, &class_name, &prop_name, &prop_len);
zend_hash_str_add_new(Z_ARRVAL_P(return_value), prop_name, prop_len, value);
} else {
zend_hash_add_new(Z_ARRVAL_P(return_value), key, value);
zend_symbtable_add_new(Z_ARRVAL_P(return_value), key, value);
}
}
}
+20 -6
View File
@@ -1574,6 +1574,7 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
{
zval zv;
int retval;
uint32_t start_lineno;
if (CG(increment_lineno)) {
CG(zend_lineno)++;
@@ -1582,6 +1583,7 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
again:
ZVAL_UNDEF(&zv);
start_lineno = CG(zend_lineno);
retval = lex_scan(&zv);
if (EG(exception)) {
return T_ERROR;
@@ -1605,7 +1607,7 @@ again:
break;
}
if (Z_TYPE(zv) != IS_UNDEF) {
elem->ast = zend_ast_create_zval(&zv);
elem->ast = zend_ast_create_zval_with_lineno(&zv, 0, start_lineno);
}
return retval;
@@ -4366,8 +4368,12 @@ void zend_compile_declare(zend_ast *ast) /* {{{ */
zend_ast *declare_ast = declares->child[i];
zend_ast *name_ast = declare_ast->child[0];
zend_ast *value_ast = declare_ast->child[1];
zend_string *name = zend_ast_get_str(name_ast);
if (value_ast->kind != ZEND_AST_ZVAL) {
zend_error_noreturn(E_COMPILE_ERROR, "declare(%s) value must be a literal", ZSTR_VAL(name));
}
if (zend_string_equals_literal_ci(name, "ticks")) {
zval value_zv;
zend_const_expr_to_zval(&value_zv, value_ast);
@@ -6663,8 +6669,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) {
resolved_name = zend_resolve_class_name_ast(class_ast);
@@ -7308,6 +7317,8 @@ void zend_compile_expr(znode *result, zend_ast *ast) /* {{{ */
void zend_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */
{
CG(zend_lineno) = zend_ast_get_lineno(ast);
switch (ast->kind) {
case ZEND_AST_VAR:
zend_compile_simple_var(result, ast, type, 0);
@@ -7604,8 +7615,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,
+2 -2
View File
@@ -556,8 +556,8 @@ static void _build_trace_args(zval *arg, smart_str *str) /* {{{ */
break;
case IS_DOUBLE: {
double dval = Z_DVAL_P(arg);
char *s_tmp = emalloc(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
int l_tmp = zend_sprintf(s_tmp, "%.*G", (int) EG(precision), dval); /* SAFE */
char *s_tmp;
size_t l_tmp = zend_spprintf(&s_tmp, MAX_LENGTH_OF_DOUBLE + EG(precision) + 1, "%.*G", (int) EG(precision), dval); /* SAFE */
smart_str_appendl(str, s_tmp, l_tmp);
smart_str_appends(str, ", ");
efree(s_tmp);
+4
View File
@@ -79,6 +79,10 @@ static zend_always_inline zval* zend_assign_to_variable(zval *variable_ptr, zval
return variable_ptr;
}
if (ZEND_CONST_COND(value_type & (IS_VAR|IS_CV), 1) && variable_ptr == value) {
if (value_type == IS_VAR && ref) {
ZEND_ASSERT(GC_REFCOUNT(ref) > 1);
--GC_REFCOUNT(ref);
}
return variable_ptr;
}
garbage = Z_COUNTED_P(variable_ptr);
+9
View File
@@ -755,6 +755,15 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
}
zend_error(E_DEPRECATED, "%s", error);
efree(error);
if (UNEXPECTED(EG(exception))) {
if (callable_name) {
zend_string_release(callable_name);
}
if (EG(current_execute_data) == &dummy_execute_data) {
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
}
return FAILURE;
}
}
zend_string_release(callable_name);
}
+74 -52
View File
@@ -25,26 +25,12 @@
/* one (0) is reserved */
#define GC_ROOT_BUFFER_MAX_ENTRIES 10001
#define GC_FAKE_BUFFER_FLAG 0x80
#define GC_TYPE_MASK 0x7f
#define GC_HAS_DESTRUCTORS (1<<0)
#ifndef ZEND_GC_DEBUG
# define ZEND_GC_DEBUG 0
#endif
#define GC_NUM_ADDITIONAL_ENTRIES \
((4096 - ZEND_MM_OVERHEAD - sizeof(void*) * 2) / sizeof(gc_root_buffer))
typedef struct _gc_addtional_bufer gc_additional_buffer;
struct _gc_addtional_bufer {
uint32_t used;
gc_additional_buffer *next;
gc_root_buffer buf[GC_NUM_ADDITIONAL_ENTRIES];
};
#ifdef ZTS
ZEND_API int gc_globals_id;
#else
@@ -53,9 +39,6 @@ ZEND_API zend_gc_globals gc_globals;
ZEND_API int (*gc_collect_cycles)(void);
#define GC_REMOVE_FROM_ROOTS(current) \
gc_remove_from_roots((current))
#if ZEND_GC_DEBUG > 1
# define GC_TRACE(format, ...) fprintf(stderr, format "\n", ##__VA_ARGS__);
# define GC_TRACE_REF(ref, format, ...) \
@@ -123,6 +106,12 @@ static zend_always_inline void gc_remove_from_roots(gc_root_buffer *root)
GC_BENCH_DEC(root_buf_length);
}
static zend_always_inline void gc_remove_from_additional_roots(gc_root_buffer *root)
{
root->next->prev = root->prev;
root->prev->next = root->next;
}
static void root_buffer_dtor(zend_gc_globals *gc_globals)
{
if (gc_globals->buf) {
@@ -149,6 +138,8 @@ static void gc_globals_ctor_ex(zend_gc_globals *gc_globals)
gc_globals->gc_runs = 0;
gc_globals->collected = 0;
gc_globals->additional_buffer = NULL;
#if GC_BENCH
gc_globals->root_buf_length = 0;
gc_globals->root_buf_peak = 0;
@@ -204,6 +195,8 @@ ZEND_API void gc_reset(void)
GC_G(first_unused) = NULL;
GC_G(last_unused) = NULL;
}
GC_G(additional_buffer) = NULL;
}
ZEND_API void gc_init(void)
@@ -276,21 +269,45 @@ ZEND_API void ZEND_FASTCALL gc_possible_root(zend_refcounted *ref)
GC_BENCH_PEAK(root_buf_peak, root_buf_length);
}
static zend_always_inline gc_root_buffer* gc_find_additional_buffer(zend_refcounted *ref)
{
gc_additional_buffer *additional_buffer = GC_G(additional_buffer);
/* We have to check each additional_buffer to find which one holds the ref */
while (additional_buffer) {
uint32_t idx = GC_ADDRESS(GC_INFO(ref)) - GC_ROOT_BUFFER_MAX_ENTRIES;
if (idx < additional_buffer->used) {
gc_root_buffer *root = additional_buffer->buf + idx;
if (root->ref == ref) {
return root;
}
}
additional_buffer = additional_buffer->next;
}
ZEND_ASSERT(0);
return NULL;
}
ZEND_API void ZEND_FASTCALL gc_remove_from_buffer(zend_refcounted *ref)
{
gc_root_buffer *root;
ZEND_ASSERT(GC_ADDRESS(GC_INFO(ref)));
ZEND_ASSERT(GC_ADDRESS(GC_INFO(ref)) < GC_ROOT_BUFFER_MAX_ENTRIES);
GC_BENCH_INC(zval_remove_from_buffer);
root = GC_G(buf) + GC_ADDRESS(GC_INFO(ref));
if (EXPECTED(GC_ADDRESS(GC_INFO(ref)) < GC_ROOT_BUFFER_MAX_ENTRIES)) {
root = GC_G(buf) + GC_ADDRESS(GC_INFO(ref));
gc_remove_from_roots(root);
} else {
root = gc_find_additional_buffer(ref);
gc_remove_from_additional_roots(root);
}
if (GC_REF_GET_COLOR(ref) != GC_BLACK) {
GC_TRACE_SET_COLOR(ref, GC_PURPLE);
}
GC_INFO(ref) = 0;
GC_REMOVE_FROM_ROOTS(root);
/* updete next root that is going to be freed */
if (GC_G(next_to_free) == root) {
@@ -641,7 +658,7 @@ static void gc_scan_roots(void)
}
}
static void gc_add_garbage(zend_refcounted *ref, gc_additional_buffer **additional_buffer)
static void gc_add_garbage(zend_refcounted *ref)
{
gc_root_buffer *buf = GC_G(unused);
@@ -664,25 +681,23 @@ static void gc_add_garbage(zend_refcounted *ref, gc_additional_buffer **addition
#endif
} else {
/* If we don't have free slots in the buffer, allocate a new one and
* set it's address to GC_ROOT_BUFFER_MAX_ENTRIES that have special
* set it's address above GC_ROOT_BUFFER_MAX_ENTRIES that have special
* meaning.
*/
if (!*additional_buffer || (*additional_buffer)->used == GC_NUM_ADDITIONAL_ENTRIES) {
if (!GC_G(additional_buffer) || GC_G(additional_buffer)->used == GC_NUM_ADDITIONAL_ENTRIES) {
gc_additional_buffer *new_buffer = emalloc(sizeof(gc_additional_buffer));
new_buffer->used = 0;
new_buffer->next = *additional_buffer;
*additional_buffer = new_buffer;
new_buffer->next = GC_G(additional_buffer);
GC_G(additional_buffer) = new_buffer;
}
buf = (*additional_buffer)->buf + (*additional_buffer)->used;
(*additional_buffer)->used++;
buf = GC_G(additional_buffer)->buf + GC_G(additional_buffer)->used;
#if 1
/* optimization: color is already GC_BLACK (0) */
GC_INFO(ref) = GC_ROOT_BUFFER_MAX_ENTRIES;
GC_INFO(ref) = GC_ROOT_BUFFER_MAX_ENTRIES + GC_G(additional_buffer)->used;
#else
GC_REF_SET_ADDRESS(ref, GC_ROOT_BUFFER_MAX_ENTRIES);
GC_REF_SET_ADDRESS(ref, GC_ROOT_BUFFER_MAX_ENTRIES) + GC_G(additional_buffer)->used;
#endif
/* modify type to prevent indirect destruction */
GC_TYPE(ref) |= GC_FAKE_BUFFER_FLAG;
GC_G(additional_buffer)->used++;
}
if (buf) {
GC_REFCOUNT(ref)++;
@@ -694,7 +709,7 @@ static void gc_add_garbage(zend_refcounted *ref, gc_additional_buffer **addition
}
}
static int gc_collect_white(zend_refcounted *ref, uint32_t *flags, gc_additional_buffer **additional_buffer)
static int gc_collect_white(zend_refcounted *ref, uint32_t *flags)
{
int count = 0;
HashTable *ht;
@@ -727,7 +742,7 @@ tail_call:
#else
if (!GC_ADDRESS(GC_INFO(ref))) {
#endif
gc_add_garbage(ref, additional_buffer);
gc_add_garbage(ref);
}
if (obj->handlers->dtor_obj &&
((obj->handlers->dtor_obj != zend_objects_destroy_object) ||
@@ -751,7 +766,7 @@ tail_call:
if (Z_REFCOUNTED_P(zv)) {
ref = Z_COUNTED_P(zv);
GC_REFCOUNT(ref)++;
count += gc_collect_white(ref, flags, additional_buffer);
count += gc_collect_white(ref, flags);
/* count non-refcounted for compatibility ??? */
} else if (Z_TYPE_P(zv) != IS_UNDEF) {
count++;
@@ -773,7 +788,7 @@ tail_call:
#else
if (!GC_ADDRESS(GC_INFO(ref))) {
#endif
gc_add_garbage(ref, additional_buffer);
gc_add_garbage(ref);
}
ht = (zend_array*)ref;
} else if (GC_TYPE(ref) == IS_REFERENCE) {
@@ -813,7 +828,7 @@ tail_call:
if (Z_REFCOUNTED_P(zv)) {
ref = Z_COUNTED_P(zv);
GC_REFCOUNT(ref)++;
count += gc_collect_white(ref, flags, additional_buffer);
count += gc_collect_white(ref, flags);
/* count non-refcounted for compatibility ??? */
} else if (Z_TYPE_P(zv) != IS_UNDEF) {
count++;
@@ -831,7 +846,7 @@ tail_call:
return count;
}
static int gc_collect_roots(uint32_t *flags, gc_additional_buffer **additional_buffer)
static int gc_collect_roots(uint32_t *flags)
{
int count = 0;
gc_root_buffer *current = GC_G(roots).next;
@@ -840,8 +855,12 @@ static int gc_collect_roots(uint32_t *flags, gc_additional_buffer **additional_b
while (current != &GC_G(roots)) {
gc_root_buffer *next = current->next;
if (GC_REF_GET_COLOR(current->ref) == GC_BLACK) {
if (EXPECTED(GC_ADDRESS(GC_INFO(current->ref)) < GC_ROOT_BUFFER_MAX_ENTRIES)) {
gc_remove_from_roots(current);
} else {
gc_remove_from_additional_roots(current);
}
GC_INFO(current->ref) = 0; /* reset GC_ADDRESS() and keep GC_BLACK */
GC_REMOVE_FROM_ROOTS(current);
}
current = next;
}
@@ -850,7 +869,7 @@ static int gc_collect_roots(uint32_t *flags, gc_additional_buffer **additional_b
while (current != &GC_G(roots)) {
GC_REFCOUNT(current->ref)++;
if (GC_REF_GET_COLOR(current->ref) == GC_WHITE) {
count += gc_collect_white(current->ref, flags, additional_buffer);
count += gc_collect_white(current->ref, flags);
}
current = current->next;
}
@@ -886,13 +905,16 @@ static void gc_remove_nested_data_from_buffer(zend_refcounted *ref, gc_root_buff
tail_call:
if (root ||
(GC_ADDRESS(GC_INFO(ref)) != 0 &&
GC_REF_GET_COLOR(ref) == GC_BLACK &&
GC_ADDRESS(GC_INFO(ref)) != GC_ROOT_BUFFER_MAX_ENTRIES)) {
GC_REF_GET_COLOR(ref) == GC_BLACK)) {
GC_TRACE_REF(ref, "removing from buffer");
GC_REFCOUNT(ref)--;
if (root) {
if (EXPECTED(GC_ADDRESS(GC_INFO(root->ref)) < GC_ROOT_BUFFER_MAX_ENTRIES)) {
gc_remove_from_roots(root);
} else {
gc_remove_from_additional_roots(root);
}
GC_INFO(ref) = 0;
GC_REMOVE_FROM_ROOTS(root);
root = NULL;
} else {
GC_REMOVE_FROM_BUFFER(ref);
@@ -986,7 +1008,7 @@ ZEND_API int zend_gc_collect_cycles(void)
zend_refcounted *p;
gc_root_buffer to_free;
uint32_t gc_flags = 0;
gc_additional_buffer *additional_buffer;
gc_additional_buffer *additional_buffer_snapshot;
#if ZEND_GC_DEBUG
zend_bool orig_gc_full;
#endif
@@ -1010,8 +1032,8 @@ ZEND_API int zend_gc_collect_cycles(void)
#endif
GC_TRACE("Collecting roots");
additional_buffer = NULL;
count = gc_collect_roots(&gc_flags, &additional_buffer);
additional_buffer_snapshot = GC_G(additional_buffer);
count = gc_collect_roots(&gc_flags);
#if ZEND_GC_DEBUG
GC_G(gc_full) = orig_gc_full;
#endif
@@ -1055,7 +1077,7 @@ ZEND_API int zend_gc_collect_cycles(void)
while (current != &to_free) {
p = current->ref;
GC_G(next_to_free) = current->next;
if ((GC_TYPE(p) & GC_TYPE_MASK) == IS_OBJECT) {
if (GC_TYPE(p) == IS_OBJECT) {
zend_object *obj = (zend_object*)p;
if (IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) &&
@@ -1092,7 +1114,7 @@ ZEND_API int zend_gc_collect_cycles(void)
p = current->ref;
GC_G(next_to_free) = current->next;
GC_TRACE_REF(p, "destroying");
if ((GC_TYPE(p) & GC_TYPE_MASK) == IS_OBJECT) {
if (GC_TYPE(p) == IS_OBJECT) {
zend_object *obj = (zend_object*)p;
if (EG(objects_store).object_buckets &&
@@ -1111,7 +1133,7 @@ ZEND_API int zend_gc_collect_cycles(void)
EG(objects_store).free_list_head = obj->handle;
p = current->ref = (zend_refcounted*)(((char*)obj) - obj->handlers->offset);
}
} else if ((GC_TYPE(p) & GC_TYPE_MASK) == IS_ARRAY) {
} else if (GC_TYPE(p) == IS_ARRAY) {
zend_array *arr = (zend_array*)p;
GC_TYPE(arr) = IS_NULL;
@@ -1133,10 +1155,10 @@ ZEND_API int zend_gc_collect_cycles(void)
current = next;
}
while (additional_buffer != NULL) {
gc_additional_buffer *next = additional_buffer->next;
efree(additional_buffer);
additional_buffer = next;
while (GC_G(additional_buffer) != additional_buffer_snapshot) {
gc_additional_buffer *next = GC_G(additional_buffer)->next;
efree(GC_G(additional_buffer));
GC_G(additional_buffer) = next;
}
GC_TRACE("Collection finished");
+13
View File
@@ -67,6 +67,17 @@ typedef struct _gc_root_buffer {
uint32_t refcount;
} gc_root_buffer;
#define GC_NUM_ADDITIONAL_ENTRIES \
((4096 - ZEND_MM_OVERHEAD - sizeof(void*) * 2) / sizeof(gc_root_buffer))
typedef struct _gc_additional_bufer gc_additional_buffer;
struct _gc_additional_bufer {
uint32_t used;
gc_additional_buffer *next;
gc_root_buffer buf[GC_NUM_ADDITIONAL_ENTRIES];
};
typedef struct _zend_gc_globals {
zend_bool gc_enabled;
zend_bool gc_active;
@@ -93,6 +104,8 @@ typedef struct _zend_gc_globals {
uint32_t zval_marked_grey;
#endif
gc_additional_buffer *additional_buffer;
} zend_gc_globals;
#ifdef ZTS
+10
View File
@@ -310,6 +310,16 @@ static zend_always_inline int zend_hash_str_exists_ind(const HashTable *ht, cons
Z_TYPE_P(Z_INDIRECT_P(zv)) != IS_UNDEF);
}
static zend_always_inline zval *zend_symbtable_add_new(HashTable *ht, zend_string *key, zval *pData)
{
zend_ulong idx;
if (ZEND_HANDLE_NUMERIC(key, idx)) {
return zend_hash_index_add_new(ht, idx, pData);
} else {
return zend_hash_add_new(ht, key, pData);
}
}
static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData)
{
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -1155,7 +1155,8 @@ NEWLINE ("\r"|"\n"|"\r\n")
RETURN_TOKEN(T_RETURN);
}
<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from" {
<ST_IN_SCRIPTING>"yield"{WHITESPACE}"from"[^a-zA-Z0-9_\x80-\xff] {
yyless(yyleng - 1);
HANDLE_NEWLINES(yytext, yyleng);
RETURN_TOKEN(T_YIELD_FROM);
}
+48 -19
View File
@@ -926,8 +926,13 @@ ZEND_API int ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2) /* {
} else if (!converted) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_ADD, add_function);
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
if (EXPECTED(op1 != op2)) {
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
} else {
zendi_convert_scalar_to_number(op1, op1_copy, result);
op2 = op1;
}
converted = 1;
} else {
zend_throw_error(NULL, "Unsupported operand types");
@@ -979,8 +984,13 @@ ZEND_API int ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2) /* {
} else if (!converted) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_SUB, sub_function);
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
if (EXPECTED(op1 != op2)) {
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
} else {
zendi_convert_scalar_to_number(op1, op1_copy, result);
op2 = op1;
}
converted = 1;
} else {
zend_throw_error(NULL, "Unsupported operand types");
@@ -1026,8 +1036,13 @@ ZEND_API int ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2) /* {
} else if (!converted) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_MUL, mul_function);
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
if (EXPECTED(op1 != op2)) {
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
} else {
zendi_convert_scalar_to_number(op1, op1_copy, result);
op2 = op1;
}
converted = 1;
} else {
zend_throw_error(NULL, "Unsupported operand types");
@@ -1104,17 +1119,27 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* {
} else if (!converted) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_POW, pow_function);
if (Z_TYPE_P(op1) == IS_ARRAY) {
ZVAL_LONG(result, 0);
return SUCCESS;
if (EXPECTED(op1 != op2)) {
if (Z_TYPE_P(op1) == IS_ARRAY) {
ZVAL_LONG(result, 0);
return SUCCESS;
} else {
zendi_convert_scalar_to_number(op1, op1_copy, result);
}
if (Z_TYPE_P(op2) == IS_ARRAY) {
ZVAL_LONG(result, 1L);
return SUCCESS;
} else {
zendi_convert_scalar_to_number(op2, op2_copy, result);
}
} else {
zendi_convert_scalar_to_number(op1, op1_copy, result);
}
if (Z_TYPE_P(op2) == IS_ARRAY) {
ZVAL_LONG(result, 1L);
return SUCCESS;
} else {
zendi_convert_scalar_to_number(op2, op2_copy, result);
if (Z_TYPE_P(op1) == IS_ARRAY) {
ZVAL_LONG(result, 0);
return SUCCESS;
} else {
zendi_convert_scalar_to_number(op1, op1_copy, result);
}
op2 = op1;
}
converted = 1;
} else {
@@ -1178,9 +1203,13 @@ ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* {
op2 = Z_REFVAL_P(op2);
} else if (!converted) {
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_DIV, div_function);
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
if (EXPECTED(op1 != op2)) {
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
} else {
zendi_convert_scalar_to_number(op1, op1_copy, result);
op2 = op1;
}
converted = 1;
} else {
zend_throw_error(NULL, "Unsupported operand types");
+13 -5
View File
@@ -131,6 +131,12 @@
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
# if defined(__has_feature)
# if __has_feature(address_sanitizer)
# define __SANITIZE_ADDRESS__
# endif
# endif
# ifndef RTLD_LAZY
# define RTLD_LAZY 1 /* Solaris 1, FreeBSD's (2.1.7.1 and older) */
# endif
@@ -141,7 +147,7 @@
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
# elif defined(RTLD_DEEPBIND)
# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__)
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL | RTLD_DEEPBIND)
# else
# define DL_LOAD(libname) dlopen(libname, RTLD_LAZY | RTLD_GLOBAL)
@@ -239,11 +245,13 @@ char *alloca();
# define ZEND_FASTCALL
#endif
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004
#else
# define __restrict__
#ifndef restrict
# if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004
# else
# define __restrict__
# endif
# define restrict __restrict__
#endif
#define restrict __restrict__
#if (defined(__GNUC__) && __GNUC__ >= 3 && !defined(__INTEL_COMPILER) && !defined(DARWIN) && !defined(__hpux) && !defined(_AIX) && !defined(__osf__)) || __has_attribute(noreturn)
# define HAVE_NORETURN
+14 -2
View File
@@ -74,12 +74,17 @@ void zend_signal_handler_defer(int signo, siginfo_t *siginfo, void *context)
{
int errno_save = errno;
zend_signal_queue_t *queue, *qtmp;
zend_bool is_handling_safe = 1;
#ifdef ZTS
ZEND_TSRMLS_CACHE_UPDATE();
/* A signal could hit after TSRM shutdown, in this case globals are already freed. */
if (NULL == TSRMLS_CACHE || NULL == TSRMG_BULK_STATIC(zend_signal_globals_id, zend_signal_globals_t *)) {
is_handling_safe = 0;
}
#endif
if (EXPECTED(SIGG(active))) {
if (EXPECTED(is_handling_safe && SIGG(active))) {
if (UNEXPECTED(SIGG(depth) == 0)) { /* try to handle signal */
if (UNEXPECTED(SIGG(blocked))) {
SIGG(blocked) = 0;
@@ -162,7 +167,14 @@ static void zend_signal_handler(int signo, siginfo_t *siginfo, void *context)
int errno_save = errno;
struct sigaction sa = {{0}};
sigset_t sigset;
zend_signal_entry_t p_sig = SIGG(handlers)[signo-1];
zend_signal_entry_t p_sig;
#ifdef ZTS
if (NULL == TSRMLS_CACHE || NULL == TSRMG_BULK_STATIC(zend_signal_globals_id, zend_signal_globals_t *)) {
p_sig.flags = 0;
p_sig.handler = SIG_DFL;
} else
#endif
p_sig = SIGG(handlers)[signo-1];
if (p_sig.handler == SIG_DFL) { /* raise default handler */
if (sigaction(signo, NULL, &sa) == 0) {
+4 -3
View File
@@ -912,9 +912,10 @@ static zend_always_inline uint32_t zval_delref_p(zval* pz) {
#define SEPARATE_STRING(zv) do { \
zval *_zv = (zv); \
if (Z_REFCOUNTED_P(_zv) && \
Z_REFCOUNT_P(_zv) > 1) { \
Z_DELREF_P(_zv); \
if (Z_REFCOUNT_P(_zv) > 1) { \
if (Z_REFCOUNTED_P(_zv)) { \
Z_DELREF_P(_zv); \
} \
zval_copy_ctor_func(_zv); \
} \
} while (0)
+2 -9
View File
@@ -380,7 +380,7 @@ CWD_API int php_sys_stat_ex(const char *path, zend_stat_t *buf, int lstat) /* {{
if ((data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
size_t len = strlen(path);
if (path[len-4] == '.') {
if (len >= 4 && path[len-4] == '.') {
if (_memicmp(path+len-3, "exe", 3) == 0 ||
_memicmp(path+len-3, "com", 3) == 0 ||
_memicmp(path+len-3, "bat", 3) == 0 ||
@@ -899,12 +899,9 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
int bufindex = 0, isabsolute = 0;
wchar_t * reparsetarget;
BOOL isVolume = FALSE;
#if VIRTUAL_CWD_DEBUG
char printname[MAX_PATH];
int printname_len;
#endif
char substitutename[MAX_PATH];
int substitutename_len;
int printname_len, substitutename_len;
int substitutename_off = 0;
if(++(*ll) > LINK_MAX) {
@@ -931,7 +928,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
if(pbuffer->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
reparsetarget = pbuffer->SymbolicLinkReparseBuffer.ReparseTarget;
#if VIRTUAL_CWD_DEBUG
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
isabsolute = (pbuffer->SymbolicLinkReparseBuffer.Flags == 0) ? 1 : 0;
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
@@ -944,7 +940,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
};
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
printname[printname_len] = 0;
#endif
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
@@ -960,7 +955,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
else if(pbuffer->ReparseTag == IO_REPARSE_TAG_MOUNT_POINT) {
isabsolute = 1;
reparsetarget = pbuffer->MountPointReparseBuffer.ReparseTarget;
#if VIRTUAL_CWD_DEBUG
printname_len = pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR);
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
reparsetarget + pbuffer->MountPointReparseBuffer.PrintNameOffset / sizeof(WCHAR),
@@ -971,7 +965,6 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
return -1;
};
printname[pbuffer->MountPointReparseBuffer.PrintNameLength / sizeof(WCHAR)] = 0;
#endif
substitutename_len = pbuffer->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR);
if (!WideCharToMultiByte(CP_THREAD_ACP, 0,
+21 -9
View File
@@ -1515,9 +1515,13 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
}
}
ZEND_VM_C_GOTO(fetch_var_return);
@@ -1539,15 +1543,19 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
FREE_OP1();
HANDLE_EXCEPTION();
}
}
ZEND_VM_C_GOTO(fetch_var_return);
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (OP1_TYPE != IS_CONST) {
zend_string_release(name);
@@ -1555,8 +1563,12 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V
FREE_OP1();
HANDLE_EXCEPTION();
}
if (OP1_TYPE == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (OP1_TYPE == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
FREE_OP1();
+177 -69
View File
@@ -5007,9 +5007,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -5031,15 +5035,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
@@ -5047,8 +5055,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CONST == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CONST == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -6963,9 +6975,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -6987,15 +7003,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
@@ -7003,8 +7023,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CONST == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CONST == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -7469,9 +7493,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -7493,15 +7521,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CONST != IS_CONST) {
zend_string_release(name);
@@ -7509,8 +7541,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CONST == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CONST == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -31389,9 +31425,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -31413,15 +31453,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
@@ -31429,8 +31473,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CV == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CV == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -33617,9 +33665,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -33641,15 +33693,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
@@ -33657,8 +33713,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CV == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CV == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -34565,9 +34625,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -34589,15 +34653,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
HANDLE_EXCEPTION();
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if (IS_CV != IS_CONST) {
zend_string_release(name);
@@ -34605,8 +34673,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
HANDLE_EXCEPTION();
}
if (IS_CV == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if (IS_CV == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
} else {
@@ -41826,9 +41898,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -41850,15 +41926,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
@@ -41866,8 +41946,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
zval_ptr_dtor_nogc(free_op1);
@@ -42829,9 +42913,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -42853,15 +42941,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
@@ -42869,8 +42961,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
zval_ptr_dtor_nogc(free_op1);
@@ -43240,9 +43336,13 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
@@ -43264,15 +43364,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
/* check if static properties were destoyed */
if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
if (type == BP_VAR_IS) {
retval = &EG(uninitialized_zval);
} else {
zend_throw_error(NULL, "Access to undeclared static property: %s::$%s", ZSTR_VAL(ce->name), ZSTR_VAL(name));
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
}
goto fetch_var_return;
}
}
retval = zend_std_get_static_property(ce, name, 0);
retval = zend_std_get_static_property(ce, name, type == BP_VAR_IS);
if (UNEXPECTED(EG(exception))) {
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
zend_string_release(name);
@@ -43280,8 +43384,12 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_
zval_ptr_dtor_nogc(free_op1);
HANDLE_EXCEPTION();
}
if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
if (EXPECTED(retval)) {
if ((IS_TMP_VAR|IS_VAR) == IS_CONST) {
CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval);
}
} else {
retval = &EG(uninitialized_zval);
}
zval_ptr_dtor_nogc(free_op1);
+3 -4
View File
@@ -12,15 +12,14 @@ if %errorlevel% neq 0 exit /b 3
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
set STABILITY=stable
) else (
set BRANCH=master
set STABILITY=staging
)
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%BRANCH%
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 --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
call phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
if %errorlevel% neq 0 exit /b 3
call buildconf.bat --force
+1 -1
View File
@@ -11,7 +11,7 @@ if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
set BRANCH=master
set STABILITY=staging
)
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%PHP_SDK_VC%-%PHP_SDK_ARCH%-%BRANCH%
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
rem setup MySQL related exts
set MYSQL_PWD=Password12!
+11 -10
View File
@@ -69,33 +69,33 @@ int zend_sprintf(char *buffer, const char *format, ...);
/* To enable the is_nan, is_infinite and is_finite PHP functions */
#ifdef NETWARE
#define HAVE_ISNAN 1
#define HAVE_ISINF 1
#define HAVE_ISFINITE 1
#define HAVE_DECL_ISNAN 1
#define HAVE_DECL_ISINF 1
#define HAVE_DECL_ISFINITE 1
#endif
#ifndef zend_isnan
#ifdef HAVE_ISNAN
#if HAVE_DECL_ISNAN
#define zend_isnan(a) isnan(a)
#elif defined(HAVE_FPCLASS)
#define zend_isnan(a) ((fpclass(a) == FP_SNAN) || (fpclass(a) == FP_QNAN))
#else
#define zend_isnan(a) 0
#define zend_isnan(a) ((a) != (a))
#endif
#endif
#ifdef HAVE_ISINF
#if HAVE_DECL_ISINF
#define zend_isinf(a) isinf(a)
#elif defined(INFINITY)
/* Might not work, but is required by ISO C99 */
#define zend_isinf(a) (((a)==INFINITY)?1:0)
#define zend_isinf(a) (((a)==INFINITY || (a)==-INFINITY)?1:0)
#elif defined(HAVE_FPCLASS)
#define zend_isinf(a) ((fpclass(a) == FP_PINF) || (fpclass(a) == FP_NINF))
#else
#define zend_isinf(a) 0
#endif
#if defined(HAVE_ISFINITE) || defined(isfinite)
#if HAVE_DECL_ISFINITE
#define zend_finite(a) isfinite(a)
#elif defined(HAVE_FINITE)
#define zend_finite(a) finite(a)
@@ -119,8 +119,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=16
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=20
PHP_EXTRA_VERSION="RC1"
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 \
+1 -1
View File
@@ -1,4 +1,4 @@
#if PHP_WIN32
#ifdef PHP_WIN32
#include "../../../../main/config.w32.h"
#else
#include <php_config.h>
+1 -1
View File
@@ -40,7 +40,7 @@ SPNEGO => Yes
SSL => Yes
SSPI => Yes
TLS-SRP => No
HTTP2 => No
HTTP2 => Yes
GSSAPI => No
KERBEROS5 => Yes
UNIX_SOCKETS => No
+3673 -3600
View File
File diff suppressed because it is too large. Load diff
+3 -3
View File
@@ -154,7 +154,7 @@ static void do_adjust_for_weekday(timelib_time* time)
{
/* To make "this week" work, where the current DOW is a "sunday" */
if (current_dow == 0 && time->relative.weekday != 0) {
time->relative.weekday = -6;
time->relative.weekday -= 7;
}
/* To make "sunday this week" work, where the current DOW is not a
@@ -354,7 +354,7 @@ static timelib_sll do_years(timelib_sll year)
return res;
}
static timelib_sll do_months(timelib_ull month, timelib_ull year)
static timelib_sll do_months(timelib_ull month, timelib_sll year)
{
if (timelib_is_leap(year)) {
return ((month_tab_leap[month - 1] + 1) * SECS_PER_DAY);
@@ -463,7 +463,7 @@ void timelib_update_ts(timelib_time* time, timelib_tzinfo* tzi)
time->sse = res;
time->sse_uptodate = 1;
time->have_relative = time->relative.have_weekday_relative = time->relative.have_special_relative = 0;
time->have_relative = time->relative.have_weekday_relative = time->relative.have_special_relative = time->relative.first_last_day_of = 0;
}
#if 0
+1
View File
@@ -189,6 +189,7 @@ void timelib_unixtime2local(timelib_time *tm, timelib_sll ts)
timelib_unixtime2gmt(tm, ts - (tm->z * 60) + (tm->dst * 3600));
tm->sse = ts;
tm->z = z;
tm->dst = dst;
break;
+18 -9
View File
@@ -339,7 +339,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_transitions_get, 0, 0, 1)
ZEND_ARG_INFO(0, timestamp_end)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO(arginfo_timezone_method_transitions_get, 0)
ZEND_BEGIN_ARG_INFO_EX(arginfo_timezone_method_transitions_get, 0, 0, 0)
ZEND_ARG_INFO(0, timestamp_begin)
ZEND_ARG_INFO(0, timestamp_end)
ZEND_END_ARG_INFO()
@@ -764,6 +764,11 @@ PHP_RSHUTDOWN_FUNCTION(date)
*/
#define DATE_FORMAT_RFC1123 "D, d M Y H:i:s O"
/*
* RFC7231, Section 7.1.1: http://tools.ietf.org/html/rfc7231
*/
#define DATE_FORMAT_RFC7231 "D, d M Y H:i:s \\G\\M\\T"
/*
* RFC2822, Section 3.3: http://www.ietf.org/rfc/rfc2822.txt
* FWS = ([*WSP CRLF] 1*WSP) / ; Folding white space
@@ -857,6 +862,7 @@ PHP_MINIT_FUNCTION(date)
REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC1036", DATE_FORMAT_RFC1036, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC1123", DATE_FORMAT_RFC1123, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC7231", DATE_FORMAT_RFC7231, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC2822", DATE_FORMAT_RFC2822, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC3339", DATE_FORMAT_RFC3339, CONST_CS | CONST_PERSISTENT);
REGISTER_STRING_CONSTANT("DATE_RFC3339_EXTENDED", DATE_FORMAT_RFC3339_EXTENDED, CONST_CS | CONST_PERSISTENT);
@@ -1141,11 +1147,12 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
case 'a': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "pm" : "am"); break;
case 'A': length = slprintf(buffer, 32, "%s", t->h >= 12 ? "PM" : "AM"); break;
case 'B': {
int retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
while (retval < 0) {
retval += 1000;
int retval = ((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10);
if (retval < 0) {
retval += 864000;
}
retval = retval % 1000;
/* Make sure to do this on a positive int to avoid rounding errors */
retval = (retval / 864) % 1000;
length = slprintf(buffer, 32, "%03d", retval);
break;
}
@@ -1336,11 +1343,12 @@ PHPAPI int php_idate(char format, time_t ts, int localtime)
/* Swatch Beat a.k.a. Internet Time */
case 'B':
retval = (((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10) / 864);
while (retval < 0) {
retval += 1000;
retval = ((((long)t->sse)-(((long)t->sse) - ((((long)t->sse) % 86400) + 3600))) * 10);
if (retval < 0) {
retval += 864000;
}
retval = retval % 1000;
/* Make sure to do this on a positive int to avoid rounding errors */
retval = (retval / 864) % 1000;
break;
/* time */
@@ -2048,6 +2056,7 @@ static void date_register_classes(void) /* {{{ */
REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850);
REGISTER_DATE_CLASS_CONST_STRING("RFC1036", DATE_FORMAT_RFC1036);
REGISTER_DATE_CLASS_CONST_STRING("RFC1123", DATE_FORMAT_RFC1123);
REGISTER_DATE_CLASS_CONST_STRING("RFC7231", DATE_FORMAT_RFC7231);
REGISTER_DATE_CLASS_CONST_STRING("RFC2822", DATE_FORMAT_RFC2822);
REGISTER_DATE_CLASS_CONST_STRING("RFC3339", DATE_FORMAT_RFC3339);
REGISTER_DATE_CLASS_CONST_STRING("RFC3339_EXTENDED", DATE_FORMAT_RFC3339_EXTENDED);
+3 -1
View File
@@ -156,7 +156,7 @@ array(18) {
}
}
..and get names of all its class constants
array(12) {
array(13) {
["ATOM"]=>
string(13) "Y-m-d\TH:i:sP"
["COOKIE"]=>
@@ -171,6 +171,8 @@ array(12) {
string(16) "D, d M y H:i:s O"
["RFC1123"]=>
string(16) "D, d M Y H:i:s O"
["RFC7231"]=>
string(21) "D, d M Y H:i:s \G\M\T"
["RFC2822"]=>
string(16) "D, d M Y H:i:s O"
["RFC3339"]=>
+11 -11
View File
@@ -43,20 +43,20 @@ foreach ($tests as $test) {
print "wanted = Monday 00:00:00\n\n";
}
?>
--EXPECT--
--EXPECTF--
Europe/Andorra
ts = Monday 2037-10-19 17:17:17 CEST
result = Monday 2037-10-26 00:00:00 CET
wanted = Monday 00:00:00
Asia/Dubai
ts = Thursday 1970-01-01 17:17:17 GST
result = Monday 1970-01-05 00:00:00 GST
ts = Thursday 1970-01-01 17:17:17 %s
result = Monday 1970-01-05 00:00:00 %s
wanted = Monday 00:00:00
Asia/Kabul
ts = Thursday 1970-01-01 17:17:17 AFT
result = Monday 1970-01-05 00:00:00 AFT
ts = Thursday 1970-01-01 17:17:17 %s
result = Monday 1970-01-05 00:00:00 %s
wanted = Monday 00:00:00
America/Antigua
@@ -130,8 +130,8 @@ result = Monday 1971-01-04 00:00:00 AST
wanted = Monday 00:00:00
Asia/Dacca
ts = Friday 1971-01-01 17:17:17 DACT
result = Monday 1971-01-04 00:00:00 DACT
ts = Friday 1971-01-01 17:17:17 %s
result = Monday 1971-01-04 00:00:00 %s
wanted = Monday 00:00:00
Europe/Brussels
@@ -150,13 +150,13 @@ result = Monday 1983-04-18 01:00:00 CEST
wanted = Monday 00:00:00
America/Buenos_Aires
ts = Monday 1974-09-30 17:17:17 ART
result = Monday 1974-10-07 00:00:00 ART
ts = Monday 1974-09-30 17:17:17 %s
result = Monday 1974-10-07 00:00:00 %s
wanted = Monday 00:00:00
America/Rosario
ts = Monday 1974-09-30 17:17:17 ART
result = Monday 1974-10-07 00:00:00 ART
ts = Monday 1974-09-30 17:17:17 %s
result = Monday 1974-10-07 00:00:00 %s
wanted = Monday 00:00:00
Europe/Vienna
+27 -27
View File
@@ -41,7 +41,7 @@ foreach ($timezones as $timezone) {
echo "\n";
}
?>
--EXPECT--
--EXPECTF--
America/Chicago
1076824799 [2004-02-14 23:59:59 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076824800 [2004-02-15 00:00:00 CST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
@@ -88,31 +88,31 @@ Asia/Jerusalem
1083099600 [2004-04-28 00:00:00 IDT] [2004-04-07 00:00:00 +21 days]
Asia/Singapore
1076774399 [2004-02-14 23:59:59 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076774400 [2004-02-15 00:00:00 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
1076774401 [2004-02-15 00:00:01 SGT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079452800 [2004-03-17 00:00:00 SGT] [2004-04-07 00:00:00 -21 days]
1080316800 [2004-03-27 00:00:00 SGT] [2004-04-07 00:00:00 11 days ago]
1080410400 [2004-03-28 02:00:00 SGT] [2004-04-07 00:00:00 -10 day +2 hours]
1081180800 [2004-04-06 00:00:00 SGT] [2004-04-07 00:00:00 -1 day]
1081267200 [2004-04-07 00:00:00 SGT] [2004-04-07 00:00:00]
1081270800 [2004-04-07 01:00:00 SGT] [2004-04-07 00:00:00 +1 hour]
1081274400 [2004-04-07 02:00:00 SGT] [2004-04-07 00:00:00 +2 hour]
1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 +1 day]
1081353600 [2004-04-08 00:00:00 SGT] [2004-04-07 00:00:00 1 day]
1083081600 [2004-04-28 00:00:00 SGT] [2004-04-07 00:00:00 +21 days]
1076774399 [2004-02-14 23:59:59 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076774400 [2004-02-15 00:00:00 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
1076774401 [2004-02-15 00:00:01 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079452800 [2004-03-17 00:00:00 %s] [2004-04-07 00:00:00 -21 days]
1080316800 [2004-03-27 00:00:00 %s] [2004-04-07 00:00:00 11 days ago]
1080410400 [2004-03-28 02:00:00 %s] [2004-04-07 00:00:00 -10 day +2 hours]
1081180800 [2004-04-06 00:00:00 %s] [2004-04-07 00:00:00 -1 day]
1081267200 [2004-04-07 00:00:00 %s] [2004-04-07 00:00:00]
1081270800 [2004-04-07 01:00:00 %s] [2004-04-07 00:00:00 +1 hour]
1081274400 [2004-04-07 02:00:00 %s] [2004-04-07 00:00:00 +2 hour]
1081353600 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 +1 day]
1081353600 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 1 day]
1083081600 [2004-04-28 00:00:00 %s] [2004-04-07 00:00:00 +21 days]
America/Sao_Paulo
1076810399 [2004-02-14 23:59:59 BRST] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076814000 [2004-02-15 00:00:00 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
1076814001 [2004-02-15 00:00:01 BRT] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079492400 [2004-03-17 00:00:00 BRT] [2004-04-07 00:00:00 -21 days]
1080356400 [2004-03-27 00:00:00 BRT] [2004-04-07 00:00:00 11 days ago]
1080450000 [2004-03-28 02:00:00 BRT] [2004-04-07 00:00:00 -10 day +2 hours]
1081220400 [2004-04-06 00:00:00 BRT] [2004-04-07 00:00:00 -1 day]
1081306800 [2004-04-07 00:00:00 BRT] [2004-04-07 00:00:00]
1081310400 [2004-04-07 01:00:00 BRT] [2004-04-07 00:00:00 +1 hour]
1081314000 [2004-04-07 02:00:00 BRT] [2004-04-07 00:00:00 +2 hour]
1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 +1 day]
1081393200 [2004-04-08 00:00:00 BRT] [2004-04-07 00:00:00 1 day]
1083121200 [2004-04-28 00:00:00 BRT] [2004-04-07 00:00:00 +21 days]
1076810399 [2004-02-14 23:59:59 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +59 seconds]
1076814000 [2004-02-15 00:00:00 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +60 seconds]
1076814001 [2004-02-15 00:00:01 %s] [2004-04-07 00:00:00 -2 months +7 days +23 hours +59 minutes +61 seconds]
1079492400 [2004-03-17 00:00:00 %s] [2004-04-07 00:00:00 -21 days]
1080356400 [2004-03-27 00:00:00 %s] [2004-04-07 00:00:00 11 days ago]
1080450000 [2004-03-28 02:00:00 %s] [2004-04-07 00:00:00 -10 day +2 hours]
1081220400 [2004-04-06 00:00:00 %s] [2004-04-07 00:00:00 -1 day]
1081306800 [2004-04-07 00:00:00 %s] [2004-04-07 00:00:00]
1081310400 [2004-04-07 01:00:00 %s] [2004-04-07 00:00:00 +1 hour]
1081314000 [2004-04-07 02:00:00 %s] [2004-04-07 00:00:00 +2 hour]
1081393200 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 +1 day]
1081393200 [2004-04-08 00:00:00 %s] [2004-04-07 00:00:00 1 day]
1083121200 [2004-04-28 00:00:00 %s] [2004-04-07 00:00:00 +21 days]
+10 -10
View File
@@ -34,18 +34,18 @@ echo date("Y-m-d H:i:s T\n", $l);
1099364400
1099364400
1099447200
2004-11-01 00:00:00 BRT
2004-11-02 01:00:00 BRST
2004-11-02 01:00:00 BRST
2004-11-02 01:00:00 BRST
2004-11-03 00:00:00 BRST
2004-11-01 00:00:00 -03
2004-11-02 01:00:00 -02
2004-11-02 01:00:00 -02
2004-11-02 01:00:00 -02
2004-11-03 00:00:00 -02
1108778400
1108868400
1108868400
1108868400
1108954800
2005-02-19 00:00:00 BRST
2005-02-20 00:00:00 BRT
2005-02-20 00:00:00 BRT
2005-02-20 00:00:00 BRT
2005-02-21 00:00:00 BRT
2005-02-19 00:00:00 -02
2005-02-20 00:00:00 -03
2005-02-20 00:00:00 -03
2005-02-20 00:00:00 -03
2005-02-21 00:00:00 -03
+26 -26
View File
@@ -200,23 +200,23 @@ print "wanted=Thursday 00:00:00\n\n";
?>
--EXPECT--
TZ=America/Mendoza - wrong day.
tStamp=Sunday 1992-10-18 17:17:17 ARST 1
result=Sunday 1992-10-25 00:00:00 ARST 1
tStamp=Sunday 1992-10-18 17:17:17 -02 1
result=Sunday 1992-10-25 00:00:00 -02 1
wanted=Sunday 00:00:00
TZ=America/Catamarca - wrong day.
tStamp=Sunday 1990-10-21 17:17:17 ARST 1
result=Sunday 1990-10-28 00:00:00 ARST 1
tStamp=Sunday 1990-10-21 17:17:17 -02 1
result=Sunday 1990-10-28 00:00:00 -02 1
wanted=Sunday 00:00:00
TZ=America/Cordoba - wrong day.
tStamp=Sunday 1990-10-21 17:17:17 ARST 1
result=Sunday 1990-10-28 00:00:00 ARST 1
tStamp=Sunday 1990-10-21 17:17:17 -02 1
result=Sunday 1990-10-28 00:00:00 -02 1
wanted=Sunday 00:00:00
TZ=America/Rosario - wrong day.
tStamp=Tuesday 1991-10-15 17:17:17 WART 0
result=Tuesday 1991-10-22 00:00:00 ARST 1
tStamp=Tuesday 1991-10-15 17:17:17 -04 0
result=Tuesday 1991-10-22 00:00:00 -02 1
wanted=Tuesday 00:00:00
TZ=Europe/Vienna - wrong day - giving unexpected results, at
@@ -231,8 +231,8 @@ result=Monday 1992-09-28 00:00:00 +04 0
wanted=Monday 00:00:00
TZ=America/Noronha - wrong day.
tStamp=Friday 1999-10-01 17:17:17 FNT 0
result=Friday 1999-10-08 00:00:00 FNST 1
tStamp=Friday 1999-10-01 17:17:17 -02 0
result=Friday 1999-10-08 00:00:00 -01 1
wanted=Friday 00:00:00
TZ=America/Havana - wrong day.
@@ -256,13 +256,13 @@ result=Friday 2003-04-04 00:00:00 EEST 1
wanted=Friday 00:00:00
TZ=Pacific/Kwajalein - wrong day.
tStamp=Friday 1993-08-13 17:17:17 KWAT 0
result=Saturday 1993-08-21 00:00:00 MHT 0
tStamp=Friday 1993-08-13 17:17:17 -12 0
result=Saturday 1993-08-21 00:00:00 +12 0
wanted=Friday 00:00:00
TZ=Asia/Ulan_Bator - wrong day.
tStamp=Saturday 2001-09-22 17:17:17 ULAST 1
result=Saturday 2001-09-29 00:00:00 ULAST 1
tStamp=Saturday 2001-09-22 17:17:17 +09 1
result=Saturday 2001-09-29 00:00:00 +09 1
wanted=Saturday 00:00:00
TZ=America/Cancun - wrong day.
@@ -286,18 +286,18 @@ result=Thursday 2002-04-11 00:00:00 MDT 1
wanted=Thursday 00:00:00
TZ=Asia/Kuala_Lumpur - wrong day.
tStamp=Monday 1981-12-28 17:17:17 MALT 0
result=Monday 1982-01-04 00:00:00 MYT 0
tStamp=Monday 1981-12-28 17:17:17 +0730 0
result=Monday 1982-01-04 00:00:00 +08 0
wanted=Monday 00:00:00
TZ=Pacific/Chatham - wrong day.
tStamp=Monday 1974-10-28 17:17:17 CHAST 0
result=Monday 1974-11-04 00:00:00 CHADT 1
tStamp=Monday 1974-10-28 17:17:17 +1245 0
result=Monday 1974-11-04 00:00:00 +1345 1
wanted=Monday 00:00:00
TZ=America/Lima - wrong day.
tStamp=Thursday 1985-12-26 17:17:17 PET 0
result=Thursday 1986-01-02 00:00:00 PEST 1
tStamp=Thursday 1985-12-26 17:17:17 -05 0
result=Thursday 1986-01-02 00:00:00 -04 1
wanted=Thursday 00:00:00
TZ=Asia/Karachi - wrong day.
@@ -306,16 +306,16 @@ result=Friday 2002-04-12 00:00:00 PKST 1
wanted=Friday 00:00:00
TZ=America/Asuncion - wrong day.
tStamp=Wednesday 2002-02-27 17:17:17 PYST 1
result=Wednesday 2002-03-06 00:00:00 PYST 1
tStamp=Wednesday 2002-02-27 17:17:17 -03 1
result=Wednesday 2002-03-06 00:00:00 -03 1
wanted=Wednesday 00:00:00
TZ=Asia/Singapore - wrong day.
tStamp=Thursday 1981-12-31 17:17:17 SGT 0
result=Thursday 1982-01-07 00:00:00 SGT 0
tStamp=Thursday 1981-12-31 17:17:17 +0730 0
result=Thursday 1982-01-07 00:00:00 +08 0
wanted=Thursday 00:00:00
TZ=America/Montevideo - wrong day.
tStamp=Thursday 2004-09-16 17:17:17 UYT 0
result=Thursday 2004-09-23 00:00:00 UYST 1
tStamp=Thursday 2004-09-16 17:17:17 -03 0
result=Thursday 2004-09-23 00:00:00 -02 1
wanted=Thursday 00:00:00
+12 -12
View File
@@ -76,13 +76,13 @@ print "wanted=Friday 00:00:00\n\n";
?>
--EXPECT--
TZ=Pacific/Rarotonga - wrong day.
tStamp=Thursday 1970-01-01 17:17:17 CKT 0
result=Tuesday 1970-01-06 00:00:00 CKT 0
tStamp=Thursday 1970-01-01 17:17:17 -1030 0
result=Tuesday 1970-01-06 00:00:00 -1030 0
wanted=Tuesday 00:00:00
TZ=Atlantic/South_Georgia - wrong day.
tStamp=Thursday 1970-01-01 17:17:17 GST 0
result=Tuesday 1970-01-06 00:00:00 GST 0
tStamp=Thursday 1970-01-01 17:17:17 -02 0
result=Tuesday 1970-01-06 00:00:00 -02 0
wanted=Tuesday 00:00:00
TZ=America/Port-au-Prince - wrong day.
@@ -91,13 +91,13 @@ result=Monday 2005-04-04 00:00:00 EDT 1
wanted=Monday 00:00:00
TZ=Pacific/Enderbury - wrong day, off by 2 days.
tStamp=Thursday 1970-01-01 17:17:17 PHOT 0
result=Monday 1970-01-05 00:00:00 PHOT 0
tStamp=Thursday 1970-01-01 17:17:17 -12 0
result=Monday 1970-01-05 00:00:00 -12 0
wanted=Monday 00:00:00
TZ=Pacific/Kiritimati - wrong day, off by 2 days.
tStamp=Thursday 1970-01-01 17:17:17 LINT 0
result=Monday 1970-01-05 00:00:00 LINT 0
tStamp=Thursday 1970-01-01 17:17:17 -1040 0
result=Monday 1970-01-05 00:00:00 -1040 0
wanted=Monday 00:00:00
TZ=America/Managua - wrong day.
@@ -106,13 +106,13 @@ result=Tuesday 2005-04-12 00:00:00 CDT 1
wanted=Tuesday 00:00:00
TZ=Pacific/Pitcairn - wrong day.
tStamp=Thursday 1970-01-01 17:17:17 PNT 0
result=Wednesday 1970-01-07 00:00:00 PNT 0
tStamp=Thursday 1970-01-01 17:17:17 -0830 0
result=Wednesday 1970-01-07 00:00:00 -0830 0
wanted=Wednesday 00:00:00
TZ=Pacific/Fakaofo - wrong day.
tStamp=Thursday 1970-01-01 17:17:17 TKT 0
result=Saturday 1970-01-03 00:00:00 TKT 0
tStamp=Thursday 1970-01-01 17:17:17 -11 0
result=Saturday 1970-01-03 00:00:00 -11 0
wanted=Saturday 00:00:00
TZ=Pacific/Johnston - wrong day.
+2 -2
View File
@@ -23,8 +23,8 @@ print "wanted=Sunday 00:00:00\n\n";
--EXPECT--
TZ=America/Jujuy - Is it OK for this to be 2 AM, rather than 1
AM as per most DST transitions?
tStamp=Monday 1990-10-15 17:17:17 WART 0
result=Monday 1990-10-22 00:00:00 WART 0
tStamp=Monday 1990-10-15 17:17:17 -04 0
result=Monday 1990-10-22 00:00:00 -04 0
wanted=Monday 00:00:00
TZ=Asia/Tbilisi - Is it OK for this to be 2 AM?
+47 -47
View File
@@ -116,11 +116,11 @@ print "wanted=Monday 00:00:00\n\n";
print "TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes\n";
date_default_timezone_set('Africa/Monrovia');
$tStamp = mktime (17, 17, 17, 1, 845, 1970);
$tStamp = mktime (17, 17, 17, 1, 730, 1970);
print "tStamp=". date("l Y-m-d H:i:s T I", $tStamp). "\n";
$strtotime_tstamp = strtotime("next Monday", $tStamp);
$strtotime_tstamp = strtotime("next Friday", $tStamp);
print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:44:30\n\n";
print "wanted=Friday 00:44:30\n\n";
print "TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes\n";
date_default_timezone_set('Asia/Katmandu');
@@ -208,7 +208,7 @@ print "result=".date("l Y-m-d H:i:s T I", $strtotime_tstamp)."\n";
print "wanted=Monday 00:30:00\n\n";
?>
--EXPECT--
--EXPECTF--
TZ=Africa/Bujumbura - *Note*: Unexpected, as does not appear to
have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 CAT 0
@@ -216,14 +216,14 @@ result=Wednesday 1970-01-07 00:00:00 CAT 0
wanted=Wednesday 00:00:00
TZ=Asia/Thimbu - Is it OK for this to be 0:30 AM? yes
tStamp=Thursday 1987-09-24 17:17:17 IST 0
result=Thursday 1987-10-01 00:30:00 BTT 0
tStamp=Thursday 1987-09-24 17:17:17 +0530 0
result=Thursday 1987-10-01 00:30:00 +06 0
wanted=Thursday 00:30:00
TZ=Indian/Cocos - Is it OK for this to be 6:30 AM? Note: does not
appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 CCT 0
result=Thursday 1970-01-08 00:00:00 CCT 0
tStamp=Thursday 1970-01-01 17:17:17 +0630 0
result=Thursday 1970-01-08 00:00:00 +0630 0
wanted=Thursday 00:00:00
TZ=Africa/Lubumbashi - Is it OK for this to be 2 AM? Note: does
@@ -233,110 +233,110 @@ result=Saturday 1970-01-03 00:00:00 CAT 0
wanted=Saturday 00:00:00
TZ=Asia/Kashgar - Is it OK for this to be 3 AM? yes
tStamp=Thursday 1980-04-24 17:17:17 XJT 0
result=Thursday 1980-05-01 00:00:00 XJT 0
tStamp=Thursday 1980-04-24 17:17:17 +06 0
result=Thursday 1980-05-01 00:00:00 +06 0
wanted=Thursday 03:00:00
TZ=Indian/Christmas - Is it OK for this to be 7 AM? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 CXT 0
result=Sunday 1970-01-04 00:00:00 CXT 0
tStamp=Thursday 1970-01-01 17:17:17 +07 0
result=Sunday 1970-01-04 00:00:00 +07 0
wanted=Sunday 00:00:00
TZ=America/Santo_Domingo - Is it OK for this to be 0:30 AM? yes
tStamp=Sunday 1970-10-18 17:17:17 EST 0
result=Sunday 1970-10-25 00:30:00 EHDT 1
result=Sunday 1970-10-25 00:30:00 -0430 1
wanted=Sunday 00:30:00
TZ=Pacific/Truk - Is it OK for this to be 10 AM? Note: does not
appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 CHUT 0
result=Tuesday 1970-01-06 00:00:00 CHUT 0
tStamp=Thursday 1970-01-01 17:17:17 +10 0
result=Tuesday 1970-01-06 00:00:00 +10 0
wanted=Tuesday 00:00:00
TZ=Pacific/Ponape - Is it OK for this to be 11 AM? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 PONT 0
result=Monday 1970-01-05 00:00:00 PONT 0
tStamp=Thursday 1970-01-01 17:17:17 +11 0
result=Monday 1970-01-05 00:00:00 +11 0
wanted=Monday 00:00:00
TZ=America/Scoresbysund - Is it OK for this to be 2 AM? yes
tStamp=Sunday 1981-03-22 17:17:17 CGT 0
result=Sunday 1981-03-29 02:00:00 EGST 1
tStamp=Sunday 1981-03-22 17:17:17 -02 0
result=Sunday 1981-03-29 02:00:00 +00 1
wanted=Sunday 02:00:00
TZ=America/Guyana - Is it OK for this to be 0:45 AM? yes
tStamp=Thursday 1975-07-24 17:17:17 GYT 0
result=Thursday 1975-07-31 00:45:00 GYT 0
tStamp=Thursday 1975-07-24 17:17:17 -0345 0
result=Thursday 1975-07-31 00:45:00 -03 0
wanted=Thursday 00:45:00
TZ=Asia/Tehran - Is it OK for this to be 0:30 AM? yes
tStamp=Tuesday 1977-10-25 17:17:17 IRST 0
result=Tuesday 1977-11-01 00:30:00 IRST 0
tStamp=Tuesday 1977-10-25 17:17:17 +0330 0
result=Tuesday 1977-11-01 00:30:00 +04 0
wanted=Tuesday 00:30:00
TZ=Pacific/Tarawa - Is it OK for this to be Midday? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 GILT 0
result=Monday 1970-01-05 00:00:00 GILT 0
tStamp=Thursday 1970-01-01 17:17:17 +12 0
result=Monday 1970-01-05 00:00:00 +12 0
wanted=Monday 00:00:00
TZ=Africa/Monrovia - Is it OK for this to be 00:44:30 AM? yes
tStamp=Monday 1972-04-24 17:17:17 LRT 0
result=Monday 1972-05-01 00:44:30 GMT 0
wanted=Monday 00:44:30
tStamp=Friday 1971-12-31 17:17:17 MMT 0
result=Friday 1972-01-07 00:44:30 GMT 0
wanted=Friday 00:44:30
TZ=Asia/Katmandu - Is it OK for this to 0:15 AM?. yes
tStamp=Wednesday 1985-12-25 17:17:17 IST 0
result=Wednesday 1986-01-01 00:15:00 NPT 0
tStamp=Wednesday 1985-12-25 17:17:17 +0530 0
result=Wednesday 1986-01-01 00:15:00 +0545 0
wanted=Wednesday 00:15:00
TZ=Pacific/Nauru - Is it OK for this to be 0:30? yes
tStamp=Tuesday 1979-04-24 17:17:17 NRT 0
result=Tuesday 1979-05-01 00:30:00 NRT 0
tStamp=Tuesday 1979-04-24 17:17:17 +1130 0
result=Tuesday 1979-05-01 00:30:00 +12 0
wanted=Tuesday 00:30:00
TZ=Pacific/Niue - Is it OK for this to be 0:30 AM? yes
tStamp=Sunday 1978-09-24 17:17:17 NUT 0
result=Sunday 1978-10-01 00:30:00 NUT 0
tStamp=Sunday 1978-09-24 17:17:17 -1130 0
result=Sunday 1978-10-01 00:30:00 -11 0
wanted=Sunday 00:30:00
TZ=Pacific/Port_Moresby - Is it OK for this to be 10 AM? No DST
or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 PGT 0
result=Thursday 1970-01-08 00:00:00 PGT 0
tStamp=Thursday 1970-01-01 17:17:17 +10 0
result=Thursday 1970-01-08 00:00:00 +10 0
wanted=Thursday 00:00:00
TZ=America/Miquelon - Is it OK for this to be 1 AM ? yes
tStamp=Thursday 1980-04-24 17:17:17 AST 0
result=Thursday 1980-05-01 01:00:00 PMST 0
result=Thursday 1980-05-01 01:00:00 -03 0
wanted=Thursday 01:00:00
TZ=Pacific/Palau - Is it OK for this to be 9 AM? No DST or
timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 PWT 0
result=Saturday 1970-01-03 00:00:00 PWT 0
tStamp=Thursday 1970-01-01 17:17:17 +09 0
result=Saturday 1970-01-03 00:00:00 +09 0
wanted=Saturday 00:00:00
TZ=Pacific/Funafuti - Is it OK for this to be midday? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 TVT 0
result=Wednesday 1970-01-07 00:00:00 TVT 0
tStamp=Thursday 1970-01-01 17:17:17 +12 0
result=Wednesday 1970-01-07 00:00:00 +12 0
wanted=Wednesday 00:00:00
TZ=Pacific/Wake - Is it OK for this to be midday? Note: does not
appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 WAKT 0
result=Tuesday 1970-01-06 00:00:00 WAKT 0
tStamp=Thursday 1970-01-01 17:17:17 +12 0
result=Tuesday 1970-01-06 00:00:00 +12 0
wanted=Tuesday 00:00:00
TZ=Pacific/Wallis - Is it OK for this to be midday? Note: does
not appear to have a DST or timezone transition.
tStamp=Thursday 1970-01-01 17:17:17 WFT 0
result=Tuesday 1970-01-06 00:00:00 WFT 0
tStamp=Thursday 1970-01-01 17:17:17 +12 0
result=Tuesday 1970-01-06 00:00:00 +12 0
wanted=Tuesday 00:00:00
TZ=America/Paramaribo - Is it OK for this to be 0:30 AM? yes
tStamp=Monday 1984-09-24 17:17:17 SRT 0
result=Monday 1984-10-01 00:30:00 SRT 0
tStamp=Monday 1984-09-24 17:17:17 -0330 0
result=Monday 1984-10-01 00:30:00 -03 0
wanted=Monday 00:30:00
+34
View File
@@ -0,0 +1,34 @@
--TEST--
Bug #72096: Swatch time value incorrect for dates before 1970
--INI--
date.timezone=UTC
--FILE--
<?php
for ($unix = 1461283200; $unix <= 1461369600; $unix += 8000) {
echo "Time:", gmdate('Y-m-d H:i:s = B', $unix), PHP_EOL;
echo "Time:", gmdate('Y-m-d H:i:s = B', $unix - 82 * 365 * 24 * 3600), PHP_EOL;
}
?>
--EXPECT--
Time:2016-04-22 00:00:00 = 041
Time:1934-05-13 00:00:00 = 041
Time:2016-04-22 02:13:20 = 134
Time:1934-05-13 02:13:20 = 134
Time:2016-04-22 04:26:40 = 226
Time:1934-05-13 04:26:40 = 226
Time:2016-04-22 06:40:00 = 319
Time:1934-05-13 06:40:00 = 319
Time:2016-04-22 08:53:20 = 412
Time:1934-05-13 08:53:20 = 412
Time:2016-04-22 11:06:40 = 504
Time:1934-05-13 11:06:40 = 504
Time:2016-04-22 13:20:00 = 597
Time:1934-05-13 13:20:00 = 597
Time:2016-04-22 15:33:20 = 689
Time:1934-05-13 15:33:20 = 689
Time:2016-04-22 17:46:40 = 782
Time:1934-05-13 17:46:40 = 782
Time:2016-04-22 20:00:00 = 875
Time:1934-05-13 20:00:00 = 875
Time:2016-04-22 22:13:20 = 967
Time:1934-05-13 22:13:20 = 967
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #72719: Relative datetime format ignores weekday on sundays only
--FILE--
<?php
echo (new DateTimeImmutable('Monday next week 13:00'))->format('l'), "\n";
echo (new DateTimeImmutable('Tuesday next week 14:00'))->format('l'), "\n";
echo (new DateTimeImmutable('Wednesday next week 14:00'))->format('l'), "\n";
echo (new DateTimeImmutable('Thursday next week 15:00'))->format('l'), "\n";
echo (new DateTimeImmutable('Friday next week 16:00'))->format('l'), "\n";
echo (new DateTimeImmutable('Saturday next week 17:00'))->format('l'), "\n";
echo (new DateTimeImmutable('Sunday next week 18:00'))->format('l'), "\n";
?>
--EXPECT--
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #73294: DateTime wrong when date string is negative
--FILE--
<?php
for ( $i = -1050; $i <= -1000; $i++ )
{
$M = "06";
$D = "22";
$dt = new DateTime("{$i}-{$M}-{$D} 00:00:00");
$expected = "{$i}-{$M}-{$D} 00:00:00";
$result = $dt->format('Y-m-d H:i:s');
if ( $expected != $result )
{
echo "Wrong: Should have been {$expected}, was {$result}\n";
}
}
?>
==DONE==
--EXPECT--
==DONE==
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #73489: wrong timestamp when call setTimeZone multi times with UTC offset
--FILE--
<?php
// example 1 - Timestamp is changing
$datetime = new DateTime('2016-11-09 20:00:00', new DateTimeZone('UTC'));
var_dump($datetime->getTimestamp());
$datetime->setTimeZone(new DateTimeZone('-03:00'));
$datetime->setTimeZone(new DateTimeZone('-03:00'));
var_dump($datetime->getTimestamp());
// example 2 - Timestamp keeps if you use getTimestamp() before second setTimeZone() calls
$datetime = new DateTime('2016-11-09 20:00:00', new DateTimeZone('UTC'));
var_dump($datetime->getTimestamp());
$datetime->setTimeZone(new DateTimeZone('-03:00'));
$datetime->getTimestamp();
$datetime->setTimeZone(new DateTimeZone('-03:00'));
var_dump($datetime->getTimestamp());
?>
--EXPECT--
int(1478721600)
int(1478721600)
int(1478721600)
int(1478721600)
+63
View File
@@ -0,0 +1,63 @@
--TEST--
Bug #73858: diff() of two relative/described DateTimes is wrong
--FILE--
<?php
/*
In the "verbose setup method" I'm trying setup the DateTime object myself
to see if it's the format string which is parsed in correctly or if it's the DateTime
object which is breaking stuff. From the testing it appears DateTime is broken somehow.
*/
$ss = 'february first day of last month midnight';
$es = 'february first day of this month midnight - 1 second';
$s = new DateTime($ss);
$e = new DateTime($es);
$d= $e->diff($s);
var_dump($d->days); // 0 ... but should be 30
$s = (new DateTime(null))->setTimestamp(strtotime($ss)); // verbose setup method
$e = (new DateTime(null))->setTimestamp(strtotime($es)); // verbose setup method
$d = $e->diff($s);
var_dump($d->days); // 30 ... and should be 30
/*
Next we will try mix/match the code to see what happens, surprisingly it seems that the end date ($e)
is the important one, if it uses the verbose method it returns the correct values.
*/
$s = (new DateTime(null))->setTimestamp(strtotime($ss)); // verbose setup method
$e = new DateTime($es);
$d= $e->diff($s);
var_dump($d->days); // 0 ... but should be 30
$s = new DateTime($ss);
$e = (new DateTime(null))->setTimestamp(strtotime($es)); // verbose setup method
$d= $e->diff($s);
var_dump($d->days); // 30 ... and should be 30
/*
This test just proves that the $e date is important BUT NOT because it's the one we call the diff() method
on, that's just coincidental that seems to imply that the "- 1 second" in the date string is the problem.
*/
$s = new DateTime($ss);
$e = (new DateTime(null))->setTimestamp(strtotime($es)); // verbose setup method
$d= $s->diff($e);
var_dump($d->days); // 30 ... and should be 30
/*
[Workaround]
This final test seems to prove that the input string is important and that the "- 1 secord" has a negative knock-on
effect on the results of the diff. By modifying the datetime with ->modify everything works as expected ...
it just means you have to be careful of how we work with DateTimes .
*/
$s = new DateTime($ss);
$e = new DateTime('february first day of this month midnight');
$e->modify('- 1 second');
var_dump($e->diff($s)->days); // 30 ... and should be 30
?>
--EXPECT--
int(30)
int(30)
int(30)
int(30)
int(30)
int(30)
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #73942: $date->modify('Friday this week') doesn't return a Friday if $date is a Sunday
--FILE--
<?php
$date1 = "2017-01-08"; // this is a Sunday
$date = new \DateTime($date1);
$date->modify('Friday this week');
$dateFormat = $date->format('Y-m-d');
echo $dateFormat, "\n";
?>
--EXPECT--
2017-01-06
+24
View File
@@ -0,0 +1,24 @@
--TEST--
Bug #74057: wrong day when using "this week" in strtotime
--FILE--
<?php
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Sun 2017-01-01")))."\n";
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Mon 2017-01-02")))."\n";
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Tue 2017-01-03")))."\n";
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Wed 2017-01-04")))."\n";
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Thu 2017-01-05")))."\n";
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Fri 2017-01-06")))."\n";
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Sat 2017-01-07")))."\n";
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Sun 2017-01-08")))."\n";
echo date("D Y-m-d", strtotime("saturday this week", strtotime("Mon 2017-01-09")))."\n";
?>
--EXPECT--
Sat 2016-12-31
Sat 2017-01-07
Sat 2017-01-07
Sat 2017-01-07
Sat 2017-01-07
Sat 2017-01-07
Sat 2017-01-07
Sat 2017-01-07
Sat 2017-01-14
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #74080 Provide an RFC7231 date time format
--FILE--
<?php
$date = mktime(17, 52, 13, 4, 30, 2016);
var_dump(date(\DateTime::RFC7231, $date));
?>
--EXPECTF--
string(29) "Sat, 30 Apr 2016 17:52:13 GMT"
+2 -2
View File
@@ -22,8 +22,8 @@ $ts->modify("+ 1 hour 1 second");
echo date_format($ts, 'D, d M Y H:i:s T'), "\n";
?>
--EXPECT--
Thu, 19 Aug 1993 23:59:59 KWAT
Sat, 21 Aug 1993 00:00:00 MHT
Thu, 19 Aug 1993 23:59:59 -12
Sat, 21 Aug 1993 00:00:00 +12
Sun, 27 Mar 2005 01:59:59 CET
Sun, 27 Mar 2005 03:00:00 CEST
Sun, 30 Oct 2005 01:59:59 CEST
+2 -2
View File
@@ -10,12 +10,12 @@ date.timezone=UTC
$location = timezone_location_get(new DateTimeZone("Europe/Oslo"));
var_dump($location);
?>
--EXPECT--
--EXPECTF--
array(4) {
["country_code"]=>
string(2) "NO"
["latitude"]=>
float(59.91666)
float(59.9166%d)
["longitude"]=>
float(10.75)
["comments"]=>
+37 -33
View File
@@ -26,7 +26,6 @@
#include "php.h"
#if HAVE_LIBXML && HAVE_DOM
#include "php_dom.h"
#include <libxml/xmlsave.h>
#include <libxml/SAX.h>
#ifdef LIBXML_SCHEMAS_ENABLED
#include <libxml/relaxng.h>
@@ -1617,54 +1616,59 @@ PHP_FUNCTION(dom_document_savexml)
dom_doc_propsptr doc_props;
int size, format, saveempty = 0;
zend_long options = 0;
xmlSaveCtxtPtr xscp;
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|O!l", &id, dom_document_class_entry, &nodep, dom_node_class_entry, &options) == FAILURE) {
return;
}
options = options | XML_SAVE_AS_XML;
DOM_GET_OBJ(docp, id, xmlDocPtr, intern);
doc_props = dom_get_doc_props(intern->document);
format = doc_props->formatoutput;
if (format) {
options = options | XML_SAVE_FORMAT;
}
buf = xmlBufferCreate();
if (!buf) {
php_error_docref(NULL, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
xscp = xmlSaveToBuffer(buf, docp->encoding, options);
if (nodep != NULL) {
/* Dump contents of Node */
DOM_GET_OBJ(node, nodep, xmlNodePtr, nodeobj);
if (node->doc != docp) {
php_dom_throw_error(WRONG_DOCUMENT_ERR, dom_get_strict_error(intern->document));
RETURN_FALSE;
}
buf = xmlBufferCreate();
if (!buf) {
php_error_docref(NULL, E_WARNING, "Could not fetch buffer");
RETURN_FALSE;
}
if (options & LIBXML_SAVE_NOEMPTYTAG) {
saveempty = xmlSaveNoEmptyTags;
xmlSaveNoEmptyTags = 1;
}
xmlNodeDump(buf, docp, node, 0, format);
if (options & LIBXML_SAVE_NOEMPTYTAG) {
xmlSaveNoEmptyTags = saveempty;
}
mem = (xmlChar*) xmlBufferContent(buf);
if (!mem) {
xmlBufferFree(buf);
RETURN_FALSE;
}
if(xmlSaveTree(xscp, node) < 0) {
xmlBufferFree(buf);
RETURN_FALSE;
}
} else {
if(xmlSaveDoc(xscp, docp) < 0) {
xmlBufferFree(buf);
RETURN_FALSE;
}
}
xmlSaveClose(xscp);
mem = (xmlChar*) xmlBufferContent(buf);
if (!mem) {
RETVAL_STRING((char *) mem);
xmlBufferFree(buf);
RETURN_FALSE;
} else {
if (options & LIBXML_SAVE_NOEMPTYTAG) {
saveempty = xmlSaveNoEmptyTags;
xmlSaveNoEmptyTags = 1;
}
/* Encoding is handled from the encoding property set on the document */
xmlDocDumpFormatMemory(docp, &mem, &size, format);
if (options & LIBXML_SAVE_NOEMPTYTAG) {
xmlSaveNoEmptyTags = saveempty;
}
if (!size || !mem) {
RETURN_FALSE;
}
RETVAL_STRINGL((char *) mem, size);
xmlFree(mem);
}
RETVAL_STRING((char *) mem);
xmlBufferFree(buf);
}
/* }}} end dom_document_savexml */
@@ -2034,16 +2038,16 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
RETURN_FALSE;
}
if (options) {
htmlCtxtUseOptions(ctxt, (int)options);
}
ctxt->vctxt.error = php_libxml_ctx_error;
ctxt->vctxt.warning = php_libxml_ctx_warning;
if (ctxt->sax != NULL) {
ctxt->sax->error = php_libxml_ctx_error;
ctxt->sax->warning = php_libxml_ctx_warning;
}
if (options) {
htmlCtxtUseOptions(ctxt, (int)options);
}
htmlParseDocument(ctxt);
newdoc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
+1 -1
View File
@@ -49,7 +49,7 @@ ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_has_child_nodes, 0, 0, 0)
ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_dom_node_clone_node, 0, 0, 0)
ZEND_ARG_INFO(0, deep)
ZEND_END_ARG_INFO();
@@ -1,33 +0,0 @@
--TEST--
DOM Document: saveXML with createElement and formatOutput
--CREDITS--
CHU Zhaowei <jhdxr@php.net>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new domDocument('1.0', 'UTF-8');
$dom->formatOutput = true;
$root = $dom->createElement('root');
$dom->appendChild($root);
$child1 = $dom->createElement('testsuite');
$root->appendChild($child1);
$child11 = $dom->createElement('testcase');
$child11->setAttribute('name', 'leaf1');
$child12 = $dom->createElement('testcase');
$child12->setAttribute('name', 'leaf2');
$child1->appendChild($child11);
$child1->appendChild($child12);
echo $dom->saveXml();
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<root>
<testsuite>
<testcase name="leaf1"/>
<testcase name="leaf2"/>
</testsuite>
</root>
-12
View File
@@ -1,12 +0,0 @@
--TEST--
Bug #50989 add support LIBXML_NOXMLDECL for DOMDocument::saveXML()
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$dom = new DomDocument();
$dom->loadXML("<foo />");
print $dom->saveXML(null,LIBXML_NOXMLDECL);
--EXPECT--
<foo/>
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Bug #74004 (DOMDocument->loadHTML and ->loadHTMLFile do not heed LIBXML_NOWARNING and LIBXML_NOERROR options)
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$doc=new DOMDocument();
$doc->loadHTML("<tag-throw></tag-throw>",LIBXML_NOERROR);
?>
===DONE===
--EXPECT--
===DONE===
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #74416 Wrong reflection on DOMNode::cloneNode
--SKIPIF--
<?php
require_once('skipif.inc');
if (!extension_loaded('reflection')) die('skip reflection extension not available');
?>
--FILE--
<?php
$rm = new ReflectionMethod(DOMNode::class, "cloneNode");
printf("%d\n%d\n", $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
foreach ($rm->getParameters() as $param) {
printf("Parameter #%d %s OPTIONAL\n", $param->getPosition(), $param->isOptional() ? "IS" : "IS NOT");
}
?>
===DONE===
--EXPECT--
1
0
Parameter #0 IS OPTIONAL
===DONE===
+93 -81
View File
@@ -1,6 +1,6 @@
diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
--- libmagic.orig/apprentice.c 2016-01-25 11:31:21.473017702 +0800
+++ libmagic/apprentice.c 2016-01-25 11:41:58.210723599 +0800
--- libmagic.orig/apprentice.c 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/apprentice.c 2017-04-10 11:43:17.272811417 +0800
@@ -29,6 +29,8 @@
* apprentice - make one pass through /etc/magic, learning its secrets.
*/
@@ -49,7 +49,18 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
#ifndef SSIZE_MAX
#define MAXMAGIC_SIZE ((ssize_t)0x7fffffff)
@@ -168,38 +173,7 @@
@@ -75,6 +80,10 @@
#endif
#endif
+#ifndef offsetof
+#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
+#endif
+
#ifndef MAP_FAILED
#define MAP_FAILED (void *) -1
#endif
@@ -168,38 +177,7 @@
{ NULL, 0, NULL }
};
@@ -89,7 +100,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
struct type_tbl_s {
const char name[16];
@@ -281,6 +255,10 @@
@@ -281,6 +259,10 @@
# undef XX
# undef XX_NULL
@@ -100,7 +111,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
private int
get_type(const struct type_tbl_s *tbl, const char *l, const char **t)
{
@@ -405,7 +383,7 @@
@@ -405,7 +387,7 @@
struct mlist *ml;
mlp->map = idx == 0 ? map : NULL;
@@ -109,7 +120,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return -1;
ml->map = NULL;
@@ -426,10 +404,8 @@
@@ -426,10 +408,8 @@
apprentice_1(struct magic_set *ms, const char *fn, int action)
{
struct magic_map *map;
@@ -120,7 +131,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (magicsize != FILE_MAGICSIZE) {
file_error(ms, 0, "magic element size %lu != %lu",
@@ -445,12 +421,13 @@
@@ -445,12 +425,13 @@
return apprentice_compile(ms, map, fn);
}
@@ -138,7 +149,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (map == NULL)
return -1;
}
@@ -458,7 +435,8 @@
@@ -458,7 +439,8 @@
for (i = 0; i < MAGIC_SETS; i++) {
if (add_mlist(ms->mlist[i], map, i) == -1) {
file_oomem(ms, sizeof(*ml));
@@ -148,7 +159,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
}
@@ -472,15 +450,6 @@
@@ -472,15 +454,6 @@
}
}
return 0;
@@ -164,7 +175,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
protected void
@@ -491,10 +460,16 @@
@@ -491,10 +464,16 @@
return;
for (i = 0; i < MAGIC_SETS; i++)
mlist_free(ms->mlist[i]);
@@ -185,7 +196,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
protected struct magic_set *
@@ -503,7 +478,7 @@
@@ -503,7 +482,7 @@
struct magic_set *ms;
size_t i, len;
@@ -194,7 +205,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
sizeof(struct magic_set)))) == NULL)
return NULL;
@@ -515,7 +490,7 @@
@@ -515,7 +494,7 @@
ms->o.buf = ms->o.pbuf = NULL;
len = (ms->c.len = 10) * sizeof(*ms->c.li);
@@ -203,7 +214,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
goto free;
ms->event_flags = 0;
@@ -531,7 +506,7 @@
@@ -531,7 +510,7 @@
ms->elf_notes_max = FILE_ELF_NOTES_MAX;
return ms;
free:
@@ -212,7 +223,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
@@ -540,30 +515,26 @@
@@ -540,30 +519,26 @@
{
if (map == NULL)
return;
@@ -256,7 +267,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
mlist->next = mlist->prev = mlist;
@@ -582,61 +553,12 @@
@@ -582,61 +557,12 @@
for (ml = mlist->next; (next = ml->next) != NULL; ml = next) {
if (ml->map)
apprentice_unmap(ml->map);
@@ -319,7 +330,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
/* const char *fn: list of magic files and directories */
protected int
file_apprentice(struct magic_set *ms, const char *fn, int action)
@@ -648,12 +570,28 @@
@@ -648,12 +574,28 @@
if (ms->mlist[0] != NULL)
file_reset(ms);
@@ -349,7 +360,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_oomem(ms, strlen(fn));
return -1;
}
@@ -666,7 +604,7 @@
@@ -666,7 +608,7 @@
mlist_free(ms->mlist[i]);
ms->mlist[i] = NULL;
}
@@ -358,7 +369,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return -1;
}
}
@@ -683,7 +621,7 @@
@@ -683,7 +625,7 @@
fn = p;
}
@@ -367,7 +378,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (errs == -1) {
for (i = 0; i < MAGIC_SETS; i++) {
@@ -1062,7 +1000,7 @@
@@ -1062,7 +1004,7 @@
mset[i].max += ALLOC_INCR;
if ((mp = CAST(struct magic_entry *,
@@ -376,7 +387,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
NULL) {
file_oomem(ms, sizeof(*mp) * mset[i].max);
return -1;
@@ -1083,13 +1021,19 @@
@@ -1083,13 +1025,19 @@
load_1(struct magic_set *ms, int action, const char *fn, int *errs,
struct magic_entry_set *mset)
{
@@ -400,7 +411,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (errno != ENOENT)
file_error(ms, errno, "cannot read magic file `%s'",
fn);
@@ -1099,8 +1043,7 @@
@@ -1099,8 +1047,7 @@
memset(&me, 0, sizeof(me));
/* read and parse this file */
@@ -410,7 +421,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
if (len == 0) /* null line, garbage, etc */
continue;
if (line[len - 1] == '\n') {
@@ -1158,8 +1101,8 @@
@@ -1158,8 +1105,8 @@
}
if (me.mp)
(void)addentry(ms, &me, mset);
@@ -421,7 +432,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
/*
@@ -1238,7 +1181,7 @@
@@ -1238,7 +1185,7 @@
mentrycount += me[i].cont_count;
slen = sizeof(**ma) * mentrycount;
@@ -430,7 +441,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_oomem(ms, slen);
return -1;
}
@@ -1260,8 +1203,8 @@
@@ -1260,8 +1207,8 @@
if (me == NULL)
return;
for (i = 0; i < nme; i++)
@@ -441,7 +452,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
private struct magic_map *
@@ -1270,18 +1213,19 @@
@@ -1270,18 +1217,19 @@
int errs = 0;
uint32_t i, j;
size_t files = 0, maxfiles = 0;
@@ -466,7 +477,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
{
file_oomem(ms, sizeof(*map));
return NULL;
@@ -1292,22 +1236,26 @@
@@ -1292,22 +1240,26 @@
(void)fprintf(stderr, "%s\n", usg_hdr);
/* load directory or file */
@@ -501,7 +512,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
continue;
}
if (files >= maxfiles) {
@@ -1315,23 +1263,22 @@
@@ -1315,23 +1267,22 @@
maxfiles = (maxfiles + 1) * 2;
mlen = maxfiles * sizeof(*filearr);
if ((filearr = CAST(char **,
@@ -531,7 +542,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
} else
load_1(ms, action, fn, &errs, mset);
if (errs)
@@ -1796,7 +1743,7 @@
@@ -1796,7 +1747,7 @@
if (me->cont_count == me->max_count) {
struct magic *nm;
size_t cnt = me->max_count + ALLOC_CHUNK;
@@ -540,7 +551,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
sizeof(*nm) * cnt))) == NULL) {
file_oomem(ms, sizeof(*nm) * cnt);
return -1;
@@ -1811,7 +1758,7 @@
@@ -1811,7 +1762,7 @@
static const size_t len = sizeof(*m) * ALLOC_CHUNK;
if (me->mp != NULL)
return 1;
@@ -549,7 +560,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_oomem(ms, len);
return -1;
}
@@ -1984,7 +1931,7 @@
@@ -1984,7 +1935,7 @@
m->type = get_standard_integer_type(l, &l);
else if (*l == 's' && !isalpha((unsigned char)l[1])) {
m->type = FILE_STRING;
@@ -558,7 +569,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
}
}
@@ -2005,7 +1952,7 @@
@@ -2005,7 +1956,7 @@
m->mask_op = 0;
if (*l == '~') {
@@ -567,7 +578,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->mask_op |= FILE_OPINVERSE;
else if (ms->flags & MAGIC_CHECK)
file_magwarn(ms, "'~' invalid for string types");
@@ -2014,7 +1961,7 @@
@@ -2014,7 +1965,7 @@
m->str_range = 0;
m->str_flags = m->type == FILE_PSTRING ? PSTRING_1_LE : 0;
if ((op = get_op(*l)) != -1) {
@@ -576,7 +587,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
int r;
if (op != FILE_OPDIVIDE) {
@@ -2119,11 +2066,6 @@
@@ -2119,11 +2070,6 @@
if (check_format(ms, m) == -1)
return -1;
}
@@ -588,7 +599,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->mimetype[0] = '\0'; /* initialise MIME type to none */
return 0;
}
@@ -2195,7 +2137,7 @@
@@ -2195,7 +2141,7 @@
private int
parse_extra(struct magic_set *ms, struct magic_entry *me, const char *line,
@@ -597,7 +608,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
{
size_t i;
const char *l = line;
@@ -2264,7 +2206,7 @@
@@ -2264,7 +2210,7 @@
struct magic *m = &me->mp[0];
return parse_extra(ms, me, line,
@@ -606,7 +617,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
sizeof(m->mimetype), "MIME", "+-/.", 1);
}
@@ -2517,14 +2459,18 @@
@@ -2517,14 +2463,18 @@
return -1;
}
if (m->type == FILE_REGEX) {
@@ -632,7 +643,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
}
return 0;
case FILE_FLOAT:
@@ -2854,68 +2800,144 @@
@@ -2854,68 +2804,144 @@
private struct magic_map *
apprentice_map(struct magic_set *ms, const char *fn)
{
@@ -745,9 +756,10 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ file_error(ms, 0, "File %d.%d supports only version %d magic "
+ "files. `%s' is version %d", FILE_VERSION_MAJOR, patchlevel,
+ VERSIONNO, dbname, version);
+ goto error;
goto error;
+ }
+
- free(dbname);
+ /* php_magic_database is a const, performing writes will segfault. This is for big-endian
+ machines only, PPC and Sparc specifically. Consider static variable or MINIT in
+ future. */
@@ -780,13 +792,12 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
+ if (NULL != fn && entries != nentries + 1) {
+ file_error(ms, 0, "Inconsistent entries in `%s' %u != %u",
+ dbname, entries, nentries + 1);
goto error;
+ goto error;
+ }
+ if (needsbyteswap)
+ for (i = 0; i < MAGIC_SETS; i++)
+ byteswap(map->magic[i], map->nmagic[i]);
- free(dbname);
+
+ if (dbname) {
+ efree(dbname);
+ }
@@ -806,7 +817,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return NULL;
}
@@ -2942,7 +2964,7 @@
@@ -2942,7 +2968,7 @@
version = ptr[1];
if (version != VERSIONNO) {
file_error(ms, 0, "File %s supports only version %d magic "
@@ -815,7 +826,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
VERSIONNO, dbname, version);
return -1;
}
@@ -2983,7 +3005,6 @@
@@ -2983,7 +3009,6 @@
{
static const size_t nm = sizeof(*map->nmagic) * MAGIC_SETS;
static const size_t m = sizeof(**map->magic);
@@ -823,7 +834,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
size_t len;
char *dbname;
int rv = -1;
@@ -2992,14 +3013,18 @@
@@ -2992,14 +3017,18 @@
struct magic m;
uint32_t h[2 + MAGIC_SETS];
} hdr;
@@ -846,7 +857,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
file_error(ms, errno, "cannot open `%s'", dbname);
goto out;
}
@@ -3008,24 +3033,25 @@
@@ -3008,24 +3037,25 @@
hdr.h[1] = VERSIONNO;
memcpy(hdr.h + 2, map->nmagic, nm);
@@ -877,7 +888,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
return rv;
}
@@ -3059,16 +3085,18 @@
@@ -3059,16 +3089,18 @@
q++;
/* Compatibility with old code that looked in .mime */
if (ms->flags & MAGIC_MIME) {
@@ -902,7 +913,7 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
/* Compatibility with old code that looked in .mime */
if (strstr(p, ".mime") != NULL)
@@ -3158,7 +3186,7 @@
@@ -3158,7 +3190,7 @@
m->offset = swap4((uint32_t)m->offset);
m->in_offset = swap4((uint32_t)m->in_offset);
m->lineno = swap4((uint32_t)m->lineno);
@@ -912,8 +923,8 @@ diff -u libmagic.orig/apprentice.c libmagic/apprentice.c
m->str_flags = swap4(m->str_flags);
}
diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
--- libmagic.orig/ascmagic.c 2016-01-25 11:31:21.495017704 +0800
+++ libmagic/ascmagic.c 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/ascmagic.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/ascmagic.c 2017-04-10 11:41:14.411268021 +0800
@@ -139,7 +139,7 @@
/* malloc size is a conservative overestimate; could be
improved, or at least realloced after conversion. */
@@ -934,8 +945,8 @@ diff -u libmagic.orig/ascmagic.c libmagic/ascmagic.c
return rv;
}
diff -u libmagic.orig/cdf.c libmagic/cdf.c
--- libmagic.orig/cdf.c 2016-01-25 11:31:21.472017703 +0800
+++ libmagic/cdf.c 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/cdf.c 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/cdf.c 2017-04-10 11:41:14.411268021 +0800
@@ -35,7 +35,7 @@
#include "file.h"
@@ -1101,8 +1112,8 @@ diff -u libmagic.orig/cdf.c libmagic/cdf.c
#ifdef CDF_DEBUG
else
diff -u libmagic.orig/cdf.h libmagic/cdf.h
--- libmagic.orig/cdf.h 2016-01-25 11:31:21.493017704 +0800
+++ libmagic/cdf.h 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/cdf.h 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/cdf.h 2017-04-10 11:41:14.412268021 +0800
@@ -35,10 +35,12 @@
#ifndef _H_CDF_
#define _H_CDF_
@@ -1131,8 +1142,8 @@ diff -u libmagic.orig/cdf.h libmagic/cdf.h
void cdf_swap_header(cdf_header_t *);
void cdf_unpack_header(cdf_header_t *, char *);
diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
--- libmagic.orig/cdf_time.c 2016-01-25 11:31:21.494017704 +0800
+++ libmagic/cdf_time.c 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/cdf_time.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/cdf_time.c 2017-04-10 11:41:14.412268021 +0800
@@ -96,7 +96,7 @@
}
@@ -1182,8 +1193,8 @@ diff -u libmagic.orig/cdf_time.c libmagic/cdf_time.c
static const cdf_timestamp_t tst = 0x01A5E403C2D59C00ULL;
static const char *ref = "Sat Apr 23 01:30:00 1977";
diff -u libmagic.orig/compress.c libmagic/compress.c
--- libmagic.orig/compress.c 2016-01-25 11:31:21.483017704 +0800
+++ libmagic/compress.c 2016-01-25 11:31:32.676017695 +0800
--- libmagic.orig/compress.c 2017-04-10 11:41:09.732268025 +0800
+++ libmagic/compress.c 2017-04-10 11:41:14.412268021 +0800
@@ -32,10 +32,11 @@
* uncompress(method, old, n, newch) - uncompress old into new,
* using method, return sizeof new
@@ -1382,8 +1393,8 @@ diff -u libmagic.orig/compress.c libmagic/compress.c
-#endif
+#endif /* if PHP_FILEINFO_UNCOMPRESS */
diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
--- libmagic.orig/elfclass.h 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/elfclass.h 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/elfclass.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/elfclass.h 2017-04-10 11:41:14.412268021 +0800
@@ -41,7 +41,7 @@
return toomany(ms, "program headers", phnum);
flags |= FLAGS_IS_CORE;
@@ -1412,8 +1423,8 @@ diff -u libmagic.orig/elfclass.h libmagic/elfclass.h
fsize, elf_getu16(swap, elfhdr.e_machine),
(int)elf_getu16(swap, elfhdr.e_shstrndx),
diff -u libmagic.orig/file.h libmagic/file.h
--- libmagic.orig/file.h 2016-01-25 11:31:21.472017703 +0800
+++ libmagic/file.h 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/file.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/file.h 2017-04-10 11:41:14.412268021 +0800
@@ -33,11 +33,9 @@
#ifndef __file_h__
#define __file_h__
@@ -1633,8 +1644,8 @@ diff -u libmagic.orig/file.h libmagic/file.h
#define __RCSID(a)
#endif
diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
--- libmagic.orig/fsmagic.c 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/fsmagic.c 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/fsmagic.c 2017-04-10 11:41:09.730268025 +0800
+++ libmagic/fsmagic.c 2017-04-10 11:41:14.413268021 +0800
@@ -63,27 +63,21 @@
# define minor(dev) ((dev) & 0xff)
#endif
@@ -1985,8 +1996,8 @@ diff -u libmagic.orig/fsmagic.c libmagic/fsmagic.c
return ret;
}
diff -u libmagic.orig/funcs.c libmagic/funcs.c
--- libmagic.orig/funcs.c 2016-01-25 11:31:21.483017704 +0800
+++ libmagic/funcs.c 2016-01-25 11:41:34.164723619 +0800
--- libmagic.orig/funcs.c 2017-04-10 11:41:09.732268025 +0800
+++ libmagic/funcs.c 2017-04-10 11:41:14.413268021 +0800
@@ -31,7 +31,6 @@
#endif /* lint */
@@ -2217,7 +2228,7 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
{
@@ -403,8 +405,8 @@
if (level >= ms->c.len) {
len = (ms->c.len += 20) * sizeof(*ms->c.li);
len = (ms->c.len = 20 + level) * sizeof(*ms->c.li);
ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
- malloc(len) :
- realloc(ms->c.li, len));
@@ -2370,9 +2381,10 @@ diff -u libmagic.orig/funcs.c libmagic/funcs.c
return buf;
}
+
Common subdirectories: libmagic.orig/.libs and libmagic/.libs
diff -u libmagic.orig/magic.c libmagic/magic.c
--- libmagic.orig/magic.c 2016-01-25 11:31:21.495017704 +0800
+++ libmagic/magic.c 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/magic.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/magic.c 2017-04-10 11:41:14.413268021 +0800
@@ -25,11 +25,6 @@
* SUCH DAMAGE.
*/
@@ -2761,8 +2773,8 @@ diff -u libmagic.orig/magic.c libmagic/magic.c
public const char *
magic_error(struct magic_set *ms)
diff -u libmagic.orig/magic.h libmagic/magic.h
--- libmagic.orig/magic.h 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/magic.h 2016-01-25 11:31:32.677017695 +0800
--- libmagic.orig/magic.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/magic.h 2017-04-10 11:41:14.413268021 +0800
@@ -88,6 +88,7 @@
const char *magic_getpath(const char *, int);
@@ -2780,8 +2792,8 @@ diff -u libmagic.orig/magic.h libmagic/magic.h
int magic_errno(magic_t);
diff -u libmagic.orig/patchlevel.h libmagic/patchlevel.h
--- libmagic.orig/patchlevel.h 2016-01-25 11:31:21.473017702 +0800
+++ libmagic/patchlevel.h 2016-01-25 11:31:32.678017695 +0800
--- libmagic.orig/patchlevel.h 2017-04-10 11:41:09.731268025 +0800
+++ libmagic/patchlevel.h 2017-04-10 11:41:14.414268021 +0800
@@ -1,34 +1,43 @@
#define FILE_VERSION_MAJOR 5
-#define patchlevel 6
@@ -2846,8 +2858,8 @@ diff -u libmagic.orig/patchlevel.h libmagic/patchlevel.h
* Revision 1.69 2008/07/02 15:27:05 christos
* welcome to 4.25
diff -u libmagic.orig/print.c libmagic/print.c
--- libmagic.orig/print.c 2016-01-25 11:31:21.495017704 +0800
+++ libmagic/print.c 2016-01-25 11:31:32.678017695 +0800
--- libmagic.orig/print.c 2017-04-10 11:41:09.738268025 +0800
+++ libmagic/print.c 2017-04-10 11:41:14.414268021 +0800
@@ -28,13 +28,17 @@
/*
* print.c - debugging printout routines
@@ -3119,8 +3131,8 @@ diff -u libmagic.orig/print.c libmagic/print.c
if (tm == NULL)
goto out;
diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
--- libmagic.orig/readcdf.c 2016-01-25 11:31:21.493017704 +0800
+++ libmagic/readcdf.c 2016-01-25 11:31:32.678017695 +0800
--- libmagic.orig/readcdf.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/readcdf.c 2017-04-10 11:41:14.414268021 +0800
@@ -26,15 +26,21 @@
#include "file.h"
@@ -3245,8 +3257,8 @@ diff -u libmagic.orig/readcdf.c libmagic/readcdf.c
#ifdef CDF_DEBUG
cdf_dump_catalog(&h, &scn);
diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
--- libmagic.orig/softmagic.c 2016-01-25 11:31:21.471017705 +0800
+++ libmagic/softmagic.c 2016-01-25 11:44:35.541684679 +0800
--- libmagic.orig/softmagic.c 2017-04-10 11:41:09.730268025 +0800
+++ libmagic/softmagic.c 2017-04-10 11:41:14.414268021 +0800
@@ -36,11 +36,19 @@
#endif /* lint */
@@ -3669,8 +3681,8 @@ diff -u libmagic.orig/softmagic.c libmagic/softmagic.c
}
case FILE_INDIRECT:
diff -u libmagic.orig/strcasestr.c libmagic/strcasestr.c
--- libmagic.orig/strcasestr.c 2016-01-25 11:31:21.494017704 +0800
+++ libmagic/strcasestr.c 2016-01-25 11:31:32.678017695 +0800
--- libmagic.orig/strcasestr.c 2017-04-10 11:41:09.737268025 +0800
+++ libmagic/strcasestr.c 2017-04-10 11:41:14.415268021 +0800
@@ -39,6 +39,8 @@
#include "file.h"
+4
View File
@@ -80,6 +80,10 @@ FILE_RCSID("@(#)$File: apprentice.c,v 1.230 2015/01/02 21:29:39 christos Exp $")
#endif
#endif
#ifndef offsetof
#define offsetof(STRUCTURE,FIELD) ((int)((char*)&((STRUCTURE*)0)->FIELD))
#endif
#ifndef MAP_FAILED
#define MAP_FAILED (void *) -1
#endif
+23 -9
View File
@@ -6,8 +6,8 @@ $context = stream_context_create(array('ssl' => array('local_cert' => dirname(__
for ($i=0; $i<10 && !$socket; ++$i) {
$port = rand(50000, 65535);
@$socket = stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
$socket = @stream_socket_server("tcp://127.0.0.1:$port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
}
//set anther random port that is not the same as $port
do{
@@ -402,20 +402,34 @@ if ($pid) {
}elseif (preg_match('/^PASV/', $buf, $matches)) {
$pasv=true;
$p2 = $pasv_port % ((int) 1 << 8);
$p1 = ($pasv_port-$p2)/((int) 1 << 8);
$host = "127.0.0.1";
if (!empty($ssl)) {
$soc = stream_socket_server("tcp://127.0.0.1:$pasv_port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
} else {
$soc = stream_socket_server("tcp://127.0.0.1:$pasv_port");
$i=0;
do {
if (!empty($ssl)) {
$soc = @stream_socket_server("tcp://127.0.0.1:$pasv_port", $errno, $errstr, STREAM_SERVER_BIND|STREAM_SERVER_LISTEN, $context);
} else {
$soc = @stream_socket_server("tcp://127.0.0.1:$pasv_port");
}
/* Could bind port, Try another port */
if (!$soc) {
$pasv_port = rand(50000, 65535);
}
$i++;
} while ($i<10 && !$soc);
if (!$soc) {
echo "$errstr ($errno)\n";
die("could not bind passive port\n");
}
$p2 = $pasv_port % ((int) 1 << 8);
$p1 = ($pasv_port-$p2)/((int) 1 << 8);
fputs($s, "227 Entering Passive Mode. (127,0,0,1,{$p1},{$p2})\r\n");
$pasvs = stream_socket_accept($soc,10);
}elseif (preg_match('/^EPSV/', $buf, $matches)) {
} elseif (preg_match('/^EPSV/', $buf, $matches)) {
fputs($s, "550 Extended passsive mode not supported.\r\n");
} elseif (preg_match('/^SITE EXEC/', $buf, $matches)) {
fputs($s, "200 OK\r\n");
+1 -1
View File
@@ -325,7 +325,7 @@ dnl Various checks for GD features
PHP_GD_FREETYPE2
dnl Header path
for i in include/gd include gd ""; do
for i in include/gd include/gd2 include gd ""; do
test -f "$PHP_GD/$i/gd.h" && GD_INCLUDE="$PHP_GD/$i"
done
+2
View File
@@ -368,6 +368,8 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagepng, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, quality)
ZEND_ARG_INFO(0, filters)
ZEND_END_ARG_INFO()
#endif
+1 -1
View File
@@ -39,7 +39,7 @@
#include "php.h"
/* This just seems unessacary */
#if PHP_WIN32
#ifdef PHP_WIN32
#define ENABLE_GD_TTF
#else
#include <php_config.h>
+10
View File
@@ -0,0 +1,10 @@
--TEST--
(Bug #74031) ReflectionFunction for imagepng returns wrong number of parameters
--FILE--
<?php
$ref = new ReflectionFunction('imagepng');
var_dump(count($ref->getParameters()));
?>
--EXPECT--
int(4)
+1 -1
View File
@@ -30,7 +30,6 @@ if test "$PHP_GETTEXT" != "no"; then
AC_MSG_ERROR(Unable to find required gettext library)
])
)
LDFLAGS=$O_LDFLAGS
AC_DEFINE(HAVE_LIBINTL,1,[ ])
PHP_NEW_EXTENSION(gettext, gettext.c, $ext_shared)
@@ -46,5 +45,6 @@ if test "$PHP_GETTEXT" != "no"; then
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dngettext, [AC_DEFINE(HAVE_DNGETTEXT, 1, [ ])])
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, dcngettext, [AC_DEFINE(HAVE_DCNGETTEXT, 1, [ ])])
AC_CHECK_LIB($GETTEXT_CHECK_IN_LIB, bind_textdomain_codeset, [AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET, 1, [ ])])
LDFLAGS=$O_LDFLAGS
fi
+2 -3
View File
@@ -227,14 +227,13 @@ static inline void Gost(PHP_GOST_CTX *context, php_hash_uint32 data[8])
static inline void GostTransform(PHP_GOST_CTX *context, const unsigned char input[32])
{
int i, j;
php_hash_uint32 data[8], temp = 0, save = 0;
php_hash_uint32 data[8], temp = 0;
for (i = 0, j = 0; i < 8; ++i, j += 4) {
data[i] = ((php_hash_uint32) input[j]) | (((php_hash_uint32) input[j + 1]) << 8) |
(((php_hash_uint32) input[j + 2]) << 16) | (((php_hash_uint32) input[j + 3]) << 24);
save = context->state[i + 8];
context->state[i + 8] += data[i] + temp;
temp = ((context->state[i + 8] < data[i]) || (context->state[i + 8] < save)) ? 1 : 0;
temp = context->state[i + 8] < data[i] ? 1 : (context->state[i + 8] == data[i] ? temp : 0);
}
Gost(context, data);
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #73127 (gost-crypto hash incorrect if input data contains long 0xFF sequence)
--FILE--
<?php // $Id$
$test1 = str_repeat("\xFF", 40);
$test2 = str_repeat("\x00", 40);
echo hash('gost-crypto', $test1),
"\n",
hash('gost', $test1),
"\n",
hash('gost-crypto', $test2),
"\n",
hash('gost', $test2),
"\n",
hash('gost-crypto', ''),
"\n",
hash('gost', '')
;
?>
--EXPECT--
231d8bb980d3faa30fee6ec475df5669cf6c24bbce22f46d6737470043a99f8e
9eaf96ba62f90fae6707f1d4274d1a9d6680f5a121d4387815aa3a6ec42439c5
bbf1f3179409c853cd3e396d67b0e10a266c218a4fd19f149c39aa4f6d37a007
a0be0b90fea5a5b50c90c9429d07bb98fa0c06f0c30210e94c7d80c3125c67ac
981e5f3ca30c841487830f84fb433e13ac1101569b9c13584ac483234cd656c0
ce85b99cc46752fffee35cab9a7b0278abb4c2d2055cff685af4912c49490f8d
+5 -1
View File
@@ -95,6 +95,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
@@ -106,7 +110,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 )
+34 -26
View File
@@ -38,26 +38,34 @@ zend_class_entry *Locale_ce_ptr = NULL;
ZEND_BEGIN_ARG_INFO_EX( locale_0_args, 0, 0, 0 )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_1_arg, 0, 0, 1 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_BEGIN_ARG_INFO_EX( locale_arg_locale, 0, 0, 1 )
ZEND_ARG_INFO( 0, locale )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_2_args, 0, 0, 2 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_BEGIN_ARG_INFO_EX( locale_accept_from_http_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, header )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_3_args, 0, 0, 3 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_ARG_INFO( 0, arg3 )
ZEND_BEGIN_ARG_INFO_EX( locale_compose_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, subtags )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_4_args, 0, 0, 4 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_ARG_INFO( 0, arg3 )
ZEND_ARG_INFO( 0, arg4 )
ZEND_BEGIN_ARG_INFO_EX( locale_2_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, locale )
ZEND_ARG_INFO( 0, in_locale )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, 0, 2 )
ZEND_ARG_INFO( 0, langtag )
ZEND_ARG_INFO( 0, locale )
ZEND_ARG_INFO( 0, canonicalize )
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, 0, 2 )
ZEND_ARG_INFO( 0, langtag )
ZEND_ARG_INFO( 0, locale )
ZEND_ARG_INFO( 0, canonicalize )
ZEND_ARG_INFO( 0, default )
ZEND_END_ARG_INFO()
/* }}} */
@@ -68,23 +76,23 @@ ZEND_END_ARG_INFO()
zend_function_entry Locale_class_functions[] = {
ZEND_FENTRY( getDefault, zif_locale_get_default , locale_0_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( setDefault, zif_locale_set_default , locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getPrimaryLanguage, ZEND_FN( locale_get_primary_language ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getScript, ZEND_FN( locale_get_script ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getRegion, ZEND_FN( locale_get_region ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getKeywords, ZEND_FN( locale_get_keywords ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( setDefault, zif_locale_set_default , locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getPrimaryLanguage, ZEND_FN( locale_get_primary_language ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getScript, ZEND_FN( locale_get_script ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getRegion, ZEND_FN( locale_get_region ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getKeywords, ZEND_FN( locale_get_keywords ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayScript, ZEND_FN( locale_get_display_script ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayRegion, ZEND_FN( locale_get_display_region ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayName, ZEND_FN( locale_get_display_name ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayLanguage, ZEND_FN( locale_get_display_language ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getDisplayVariant, ZEND_FN( locale_get_display_variant ), locale_2_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( composeLocale, ZEND_FN( locale_compose ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( parseLocale, ZEND_FN( locale_parse ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getAllVariants, ZEND_FN( locale_get_all_variants ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( filterMatches, ZEND_FN( locale_filter_matches ), locale_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( lookup, ZEND_FN( locale_lookup ), locale_4_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( canonicalize, ZEND_FN( locale_canonicalize ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( acceptFromHttp, ZEND_FN( locale_accept_from_http ), locale_1_arg , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( composeLocale, ZEND_FN( locale_compose ), locale_compose_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( parseLocale, ZEND_FN( locale_parse ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( getAllVariants, ZEND_FN( locale_get_all_variants ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( filterMatches, ZEND_FN( locale_filter_matches ), locale_filter_matches_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( lookup, ZEND_FN( locale_lookup ), locale_lookup_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( canonicalize, ZEND_FN( locale_canonicalize ), locale_arg_locale , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( acceptFromHttp, ZEND_FN( locale_accept_from_http ), locale_accept_from_http_args , ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
PHP_FE_END
};
/* }}} */
+5 -6
View File
@@ -29,10 +29,9 @@ zend_class_entry *Normalizer_ce_ptr = NULL;
/* {{{ Normalizer methods arguments info */
ZEND_BEGIN_ARG_INFO_EX( normalizer_3_args, 0, 0, 3 )
ZEND_ARG_INFO( 0, arg1 )
ZEND_ARG_INFO( 0, arg2 )
ZEND_ARG_INFO( 0, arg3 )
ZEND_BEGIN_ARG_INFO_EX( normalizer_args, 0, 0, 1 )
ZEND_ARG_INFO( 0, input )
ZEND_ARG_INFO( 0, form )
ZEND_END_ARG_INFO()
/* }}} */
@@ -42,8 +41,8 @@ ZEND_END_ARG_INFO()
*/
zend_function_entry Normalizer_class_functions[] = {
ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_3_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( normalize, ZEND_FN( normalizer_normalize ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
ZEND_FENTRY( isNormalized, ZEND_FN( normalizer_is_normalized ), normalizer_args, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
PHP_FE_END
};
/* }}} */
+6 -1
View File
@@ -159,6 +159,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)
@@ -645,7 +650,7 @@ 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 )
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #74230 iconv fails to fail on surrogates
--SKIPIF--
<?php if(!extension_loaded('iconv')) print 'skip'; ?>
--FILE--
<?php
$high = "\xED\xa1\x92"; // codepoint D852
$low = "\xED\xBD\xA2"; // codepoint DF62
$pair = $high.$low;
var_dump(
@\iconv('UTF-8', 'UTF-8', $high) === false,
@\iconv('UTF-8', 'UTF-8', $low) === false,
@\iconv('UTF-8', 'UTF-8', $pair) === false
);
?>
--EXPECT--
bool(true)
bool(true)
bool(true)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #74433 Wrong reflection on the Normalizer methods
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not available'); ?>
--FILE--
<?php
$rm = new ReflectionMethod(Normalizer::class, 'isNormalized');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
$rm = new ReflectionMethod(Normalizer::class, 'normalize');
var_dump($rm->getNumberOfParameters());
var_dump($rm->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(2)
int(1)
int(2)
int(1)
===DONE===
+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===
+54
View File
@@ -0,0 +1,54 @@
--TEST--
Bug #74439 Wrong reflection on the Locale methods
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not available'); ?>
--FILE--
<?php
$methods = [
'getDefault',
'acceptFromHttp',
'canonicalize',
'composeLocale',
'getAllVariants',
'getKeywords',
'getPrimaryLanguage',
'getRegion',
'getScript',
'parseLocale',
'setDefault',
'getDisplayLanguage',
'getDisplayName',
'getDisplayRegion',
'getDisplayScript',
'getDisplayVariant',
'filterMatches',
'lookup',
];
foreach ($methods as $method) {
$rm = new ReflectionMethod(Locale::class, $method);
printf("%s: %d, %d\n", $method, $rm->getNumberOfParameters(), $rm->getNumberOfRequiredParameters());
}
?>
===DONE===
--EXPECT--
getDefault: 0, 0
acceptFromHttp: 1, 1
canonicalize: 1, 1
composeLocale: 1, 1
getAllVariants: 1, 1
getKeywords: 1, 1
getPrimaryLanguage: 1, 1
getRegion: 1, 1
getScript: 1, 1
parseLocale: 1, 1
setDefault: 1, 1
getDisplayLanguage: 2, 1
getDisplayName: 2, 1
getDisplayRegion: 2, 1
getDisplayScript: 2, 1
getDisplayVariant: 2, 1
filterMatches: 3, 2
lookup: 4, 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==
+2 -2
View File
@@ -26,7 +26,7 @@
#if HAVE_LIBMCRYPT
#if PHP_WIN32
#ifdef PHP_WIN32
# include "win32/winutil.h"
#endif
@@ -1376,7 +1376,7 @@ PHP_FUNCTION(mcrypt_create_iv)
iv = ecalloc(size + 1, 1);
if (source == RANDOM || source == URANDOM) {
#if PHP_WIN32
#ifdef PHP_WIN32
/* random/urandom equivalent on Windows */
BYTE *iv_b = (BYTE *) iv;
if (php_win32_get_random_bytes(iv_b, (size_t) size) == FAILURE){
+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);
+27
View File
@@ -0,0 +1,27 @@
--TEST--
Bug #73800 (sporadic segfault with MYSQLI_OPT_INT_AND_FLOAT_NATIVE)
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
if (PHP_INT_SIZE != 8) die('skip requires 64-bit');
?>
--FILE--
<?php
require_once("connect.inc");
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link->query('SET @@global.max_allowed_packet = 67108864');
$link->close();
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, 1);
$res = $link->query("SELECT RPAD('1',9000000,'1') as a,RPAD('1',9000000,'1') as b, 9223372036854775807 as c");
$r = $res->fetch_array();
var_dump($r['c']);
?>
--EXPECT--
int(9223372036854775807)
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #74021 (fetch_array broken data. Data more then MEDIUMBLOB)
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--FILE--
<?php
require_once("connect.inc");
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$link->query('SET @@global.max_allowed_packet = 67108864');
$link->close();
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
$res = $link->query("SELECT RPAD('1',9000000,'1') as a,RPAD('1',9000000,'1') as b");
$r = $res->fetch_array();
var_dump(md5($r['a']));
var_dump(md5($r['b']));
?>
--EXPECT--
string(32) "42ca0fd16ab6b6d4b9d47dc0a4a8b12a"
string(32) "42ca0fd16ab6b6d4b9d47dc0a4a8b12a"
+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===
@@ -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
}
+47
View File
@@ -688,6 +688,53 @@ const MYSQLND_CHARSET mysqlnd_charsets[] =
{ 249, "gb18030", "gb18030_bin", 1, 4, "", mysqlnd_mbcharlen_gb18030, my_ismbchar_gb18030},
{ 254, UTF8_MB3, UTF8_MB3"_general_cs", 1, 3, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 255, UTF8_MB4, UTF8_MB4"_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 256, UTF8_MB4, UTF8_MB4"_de_pb_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 257, UTF8_MB4, UTF8_MB4"_is_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 258, UTF8_MB4, UTF8_MB4"_lv_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 259, UTF8_MB4, UTF8_MB4"_ro_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 260, UTF8_MB4, UTF8_MB4"_sl_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 261, UTF8_MB4, UTF8_MB4"_pl_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 262, UTF8_MB4, UTF8_MB4"_et_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 263, UTF8_MB4, UTF8_MB4"_es_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 264, UTF8_MB4, UTF8_MB4"_sv_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 265, UTF8_MB4, UTF8_MB4"_tr_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 266, UTF8_MB4, UTF8_MB4"_cs_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 267, UTF8_MB4, UTF8_MB4"_da_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 268, UTF8_MB4, UTF8_MB4"_lt_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 269, UTF8_MB4, UTF8_MB4"_sk_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 270, UTF8_MB4, UTF8_MB4"_es_trad_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 271, UTF8_MB4, UTF8_MB4"_la_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 272, UTF8_MB4, UTF8_MB4"_fa_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 273, UTF8_MB4, UTF8_MB4"_eo_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 274, UTF8_MB4, UTF8_MB4"_hu_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 275, UTF8_MB4, UTF8_MB4"_hr_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 276, UTF8_MB4, UTF8_MB4"_si_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 277, UTF8_MB4, UTF8_MB4"_vi_0900_ai_ci", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 278, UTF8_MB4, UTF8_MB4"_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 279, UTF8_MB4, UTF8_MB4"_de_pb_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 280, UTF8_MB4, UTF8_MB4"_is_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 281, UTF8_MB4, UTF8_MB4"_lv_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 282, UTF8_MB4, UTF8_MB4"_ro_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 283, UTF8_MB4, UTF8_MB4"_sl_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 284, UTF8_MB4, UTF8_MB4"_pl_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 285, UTF8_MB4, UTF8_MB4"_et_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 286, UTF8_MB4, UTF8_MB4"_es_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 287, UTF8_MB4, UTF8_MB4"_sv_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 288, UTF8_MB4, UTF8_MB4"_tr_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 289, UTF8_MB4, UTF8_MB4"_cs_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 290, UTF8_MB4, UTF8_MB4"_da_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 291, UTF8_MB4, UTF8_MB4"_lt_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 292, UTF8_MB4, UTF8_MB4"_sk_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 293, UTF8_MB4, UTF8_MB4"_es_trad_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 294, UTF8_MB4, UTF8_MB4"_la_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 295, UTF8_MB4, UTF8_MB4"_fa_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 296, UTF8_MB4, UTF8_MB4"_eo_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 297, UTF8_MB4, UTF8_MB4"_hu_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 298, UTF8_MB4, UTF8_MB4"_hr_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 299, UTF8_MB4, UTF8_MB4"_si_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 300, UTF8_MB4, UTF8_MB4"_vi_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 303, UTF8_MB4, UTF8_MB4"_ja_0900_as_cs", 1, 4, "", mysqlnd_mbcharlen_utf8, check_mb_utf8_valid},
{ 0, NULL, NULL, 0, 0, NULL, NULL, NULL}
};
/* }}} */
+2 -2
View File
@@ -129,7 +129,7 @@ MYSQLND_METHOD(mysqlnd_stmt, store_result)(MYSQLND_STMT * const s)
} else {
COPY_CLIENT_ERROR(*conn->error_info, result->stored_data->error_info);
stmt->result->m.free_result_contents(stmt->result);
mnd_efree(stmt->result);
mnd_pefree(stmt->result, stmt->result->persistent);
stmt->result = NULL;
stmt->state = MYSQLND_STMT_PREPARED;
}
@@ -356,7 +356,7 @@ mysqlnd_stmt_prepare_read_eof(MYSQLND_STMT * s)
if (FAIL == (ret = PACKET_READ(fields_eof, stmt->conn))) {
if (stmt->result) {
stmt->result->m.free_result_contents(stmt->result);
mnd_efree(stmt->result);
mnd_pefree(stmt->result, stmt->result->persistent);
memset(stmt, 0, sizeof(MYSQLND_STMT_DATA));
stmt->state = MYSQLND_STMT_INITTED;
}
+4 -4
View File
@@ -1458,7 +1458,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
zero-length byte, don't read the body, there is no such.
*/
*data_size = prealloc_more_bytes;
*data_size = 0;
while (1) {
if (FAIL == mysqlnd_read_header(conn->net, &header, conn->stats, conn->error_info)) {
ret = FAIL;
@@ -1469,7 +1469,8 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
if (first_iteration) {
first_iteration = FALSE;
*buffer = result_set_memory_pool->get_chunk(result_set_memory_pool, *data_size);
*buffer = result_set_memory_pool->get_chunk(
result_set_memory_pool, *data_size + prealloc_more_bytes);
if (!*buffer) {
ret = FAIL;
break;
@@ -1484,7 +1485,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
/*
We have to realloc the buffer.
*/
if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size)) {
if (FAIL == (*buffer)->resize_chunk((*buffer), *data_size + prealloc_more_bytes)) {
SET_OOM_ERROR(*conn->error_info);
ret = FAIL;
break;
@@ -1507,7 +1508,6 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s
(*buffer)->free_chunk((*buffer));
*buffer = NULL;
}
*data_size -= prealloc_more_bytes;
DBG_RETURN(ret);
}
/* }}} */
+4
View File
@@ -1722,6 +1722,7 @@ php_oci_bind *php_oci_bind_array_helper_string(zval *var, zend_long max_table_le
}
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0);
memset(bind->array.elements, 0, max_table_length * (maxlength + 1) * sizeof(text));
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
@@ -1781,6 +1782,7 @@ php_oci_bind *php_oci_bind_array_helper_number(zval *var, zend_long max_table_le
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (ub4 *)safe_emalloc(max_table_length, sizeof(ub4), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1820,6 +1822,7 @@ php_oci_bind *php_oci_bind_array_helper_double(zval *var, zend_long max_table_le
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (double *)safe_emalloc(max_table_length, sizeof(double), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
@@ -1860,6 +1863,7 @@ php_oci_bind *php_oci_bind_array_helper_date(zval *var, zend_long max_table_leng
hash = HASH_OF(var);
bind = emalloc(sizeof(php_oci_bind));
ZVAL_UNDEF(&bind->parameter);
bind->array.elements = (OCIDate *)safe_emalloc(max_table_length, sizeof(OCIDate), 0);
bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var));
bind->array.old_length = bind->array.current_length;
Loaded 100 of 263 files, more files were not shown because too many files have changed in this diff. Show more