Compare commits

..
325 Commits
Author SHA1 Message Date
Anatol Belski b4c9234d03 Fix date 2018-03-27 16:03:42 +02:00
Anatol Belski c1300fda2e Set versions 2018-03-27 15:07:12 +02:00
Anatol Belski ca51458081 [ci skip] Update NEWS 2018-03-27 14:26:06 +02:00
Anatol Belski e2b7392b96 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  [ci skip] Update NEWS
2018-03-27 14:25:24 +02:00
Anatol Belski 2885f62816 [ci skip] Update NEWS 2018-03-27 14:24:43 +02:00
Jakub Zelenka 276d19feaa Do not set PR_SET_DUMPABLE by default 2018-03-27 14:19:36 +02:00
Anatol Belski eac822e897 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Do not set PR_SET_DUMPABLE by default
2018-03-27 14:19:22 +02:00
Jakub Zelenka d20bebfe13 Do not set PR_SET_DUMPABLE by default 2018-03-27 14:18:01 +02:00
Ferenc Kovacs c28a6253e5 Merge branch 'PHP-5.6' into PHP-7.0 2018-02-28 00:00:12 +01:00
Ferenc Kovacs 3db7427b71 5.6.35 is next 2018-02-27 23:57:06 +01:00
Anatol Belski c61b56ed00 7.0.29 next 2018-02-27 11:48:49 +01:00
Anatol Belski fed294d2a8 [ci skip] Update NEWS 2018-02-27 11:33:40 +01:00
Anatol Belski 1e0499b095 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  [ci skip] Update NEWS
2018-02-27 11:32:26 +01:00
Anatol Belski 4698a412bf [ci skip] Update NEWS 2018-02-27 11:31:37 +01:00
Stanislav Malyshev dde7a05978 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fix bug #75981: prevent reading beyond buffer start
2018-02-26 22:26:26 -08:00
Stanislav Malyshev 523f230c83 Fix bug #75981: prevent reading beyond buffer start 2018-02-26 22:25:51 -08:00
Stanislav Malyshev 09a19e778b Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  [ci skip] Set FPM maintainership
2018-02-23 17:57:26 -08:00
Stanislav Malyshev 1f4b057b63 [ci skip] Set FPM maintainership
As per http://news.php.net/php.internals/101897, Jakub is officially
annointed as new FPM maintainer.
2018-02-23 16:43:10 -08:00
Sara Golemon e88e83d3e5 Use Z_EXPECTED_LONG to initialize FAST_ZPP parsing loop 2018-01-23 09:24:10 -05:00
Remi Collet 27347613fe Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  2018
2018-01-03 15:12:56 +01:00
Remi Collet 67ec3ce1ec 2018 2018-01-03 15:12:39 +01:00
Remi Collet 1aa8e42036 2018 2018-01-03 15:04:48 +01:00
Ferenc Kovacs 4888495178 Merge branch 'PHP-5.6' into PHP-7.0 2018-01-03 00:33:20 +01:00
Ferenc Kovacs 028507f1f6 php 5.6.34 is next 2018-01-03 00:30:58 +01:00
Anatol Belski 5d8e298ebf [ci skip] update NEWS 2018-01-02 07:49:09 +01:00
Stanislav Malyshev 459ab2eef4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Update NEWS
  Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
  Fix bug #74782: remove file name from output to avoid XSS
2018-01-01 20:28:01 -08:00
Stanislav Malyshev 2881199c80 Update NEWS 2018-01-01 19:53:00 -08:00
Christoph M. Becker 8d6e958867 Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
Due to a signedness confusion in `GetCode_` a corrupt GIF file can
trigger an infinite loop.  Furthermore we make sure that a GIF without
any palette entries is treated as invalid *after* open palette entries
have been removed.
2018-01-01 19:51:26 -08:00
Stanislav Malyshev 73ca9b3773 Fix bug #74782: remove file name from output to avoid XSS 2018-01-01 19:51:02 -08:00
Anatol Belski e19c71e3d5 [ci skip] update NEWS 2017-12-22 18:22:33 +01:00
Dmitry Stogov da61c7a2a4 Fixed bug #75579 (Interned strings buffer overflow may cause crash)
(cherry picked from commit 37bf8bdc14)
2017-12-22 18:22:08 +01:00
Anatol Belski 484c11a541 7.0.28 is next 2017-12-05 08:51:30 +01:00
Anatol Belski dab205cb9a [ci skip] update NEWS 2017-12-05 08:41:24 +01:00
Anatol Belski 0eb262eacb Use dtor unconditionally in error case 2017-12-04 14:15:42 +01:00
Xinchen Hui d4dee4a614 Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26)
(cherry picked from commit 3b9ba7b6bd)
2017-12-04 11:50:44 +01:00
Andy Postnikov d6d4f2a9b3 Fix ZEND_SIGNED_MULTIPLY_LONG for AArch64
Register operands are required in this context.

This is a backport of 8c8679207a
to PHP 7.0+. The current code caused incorrect behavior on AArch64
when compiling with clang.
2017-12-02 18:10:17 +01:00
Anatol Belski 958fdc997c Consider Xdebug for tmi ini generation, too 2017-12-01 16:01:34 +01:00
Dmitry Stogov 24d5adbd5a Set trailing zero 2017-12-01 17:00:11 +03:00
Lior Kaplan 32e3d7b99e Define floorf if system doesn't have it (follow up for 22c48761)
floorf is checked in config.m4
2017-11-29 16:46:47 +01:00
Remi Collet 26656684ea NEWS 2017-11-28 17:59:16 +01:00
Remi Collet 8e5b9532da Fixed bug #64938 libxml_disable_entity_loader setting is shared between requests (FPM) 2017-11-28 17:58:28 +01:00
Sebastian Ramadan 7e0feb8856 Check for binary_location allocation failure 2017-11-22 04:49:04 +00:00
Scott 269d160159 Fix bug #75409 2017-11-22 04:26:54 +00:00
Anatol Belski 38be3c4ac4 [ci skip] update NEWS 2017-11-21 22:22:21 +01:00
Nester 8fdef981ef Fixed #75539 and #74183 - preg_last_error not returning error code after error 2017-11-21 20:10:18 +01:00
Remi Collet 702ef27364 Better fix bug #75540 Segfault with libzip 1.3.1
- only 1.3.1 is affected
- fix use after free
2017-11-20 09:42:20 +01:00
Remi Collet 8832c46607 NEWS 2017-11-20 08:50:33 +01:00
Remi Collet de47d4792f fix bug #75540 Segfault with libzip 1.3.1 2017-11-20 08:49:46 +01:00
Nikita Popov 0e097f2c96 Fixed bug #75535
The sizeof()s for Content-Length and Transfer-Encoding were missing
the trailing ":". Apart from being generally wrong, this no longer
verified that the header actually contains a colon, leading to the
null http_header_value being used.

Additionally, in the interest of being defensive, also make sure
that http_header_value is non-null by setting it to the end of
the header line (effectively an empty string) if there is no colon.
If the following conditions are correct, this value is not going
to be used though.
2017-11-17 23:18:05 +01:00
Anatol Belski 1ed08f9877 Update SDK version for AppVeyor 2017-11-17 16:37:00 +01:00
Sammy Kaye Powers a5206bc690 Update NEWS 2017-11-14 20:00:45 +01:00
Sammy Kaye Powers 3bc5c9f118 Fix bug 60471 by correctly identifying unused speculative preconnections
* Correctly identify unused speculative preconnections from browsers
  like Chrome and Firefox
* Add a new message to the debug level that is emitted when a TCP
  connection is closed without sending any request (a preconnection)
* Fix an issue where the existing debug messages were not being
  displayed even when debug mode was enabled
2017-11-14 20:00:45 +01:00
Anatol Belski df615f47bd [ci skip] update NEWS 2017-11-10 11:40:16 +01:00
Anatol Belski c6720e2f45 Fixed #75384 PHP seems incompatible with OneDrive files on demand 2017-11-08 11:52:42 +01:00
Derick Rethans ca0bcf535c Fixed ext/date tests due to changes in Olson database 2017-11-07 11:25:28 +00:00
Anatol Belski bc7d4dc523 7.0.27 next 2017-11-07 10:07:52 +01:00
Anatol Belski c3be49e07d Update libs_version.txt 2017-11-02 22:41:12 +01:00
Nikita Popov d88ef8d7e1 Fix ext/soap/tests/bug69137.phpt
Switch to example.org. Also mark it as an online test.
2017-11-02 20:56:03 +01:00
Anatol Belski dbfa0140ae Sync and fix tests for ICU 60.1 compat 2017-11-02 12:37:04 +01:00
Anatol Belski f5358c0e23 Yet one /nologo 2017-11-02 09:21:22 +01:00
Anatol Belski 8a3e2a6b14 Fix year 2017-10-31 10:25:15 +01:00
Anatol Belski 164167f3da Add /nologo 2017-10-31 10:24:34 +01:00
Anatol Belski 68c500421c Add missing ICU version check 2017-10-30 18:15:26 +01:00
Jakub Zelenka fc169d2133 Prevent leaking x509 and csr resources if it is not requested
All functions using php_openssl_x509_from_zval or php_openssl_csr_from_zval
with makeresource equal to 0 do not deref the resource which means there
is a leak till the end of the request. This can cause issues for long
running apps. It is a generic solution for bug #75363 which also covers
other functions.
2017-10-30 16:40:56 +00:00
Jakub Zelenka d8ccffa79a Extend and speed up pkey export tests 2017-10-30 16:40:56 +00:00
Jakub Zelenka e78e839e53 Rewrite openssl_csr_get_subject test to improve coverage 2017-10-30 16:40:56 +00:00
Jakub Zelenka 528aa540b4 Add openssl_csr_get_public_key test 2017-10-30 16:40:56 +00:00
Jakub Zelenka 548798818b Extend openssl_pkcs7_* tests to cover resource cert 2017-10-30 16:40:56 +00:00
Jakub Zelenka 55d92413b9 Fix cleaning tmp output file in openssl_csr_export_to_file test 2017-10-30 16:40:56 +00:00
Jelle van der Waa 5812f7a8d3 openssl: add basic openssl_csr_export_to_file tests
Add a basic test for openssl_csr_export_to_file.
2017-10-30 16:40:56 +00:00
Jakub Zelenka 628a52d365 Extend openssl_csr_sign test to cover cert resource 2017-10-30 16:40:56 +00:00
Jakub Zelenka 80191eebec Set different invalid path in openssl_pkcs12_export so it is more unlikely to exist 2017-10-30 16:40:55 +00:00
Jakub Zelenka cd66aad141 Extend openssl_x509_parse to cover cert resource 2017-10-30 16:40:55 +00:00
Jakub Zelenka c1d98588a2 Rename and test resource cert in openssl_x509_checkpurpose test 2017-10-30 16:40:55 +00:00
Jakub Zelenka d23d4fd61b Extend openssl_x509_check_private_key to test resource cert 2017-10-30 16:40:55 +00:00
Jakub Zelenka be0758b75a Extend openssl_x509_fingerprint test to cover resource cert with sha1 2017-10-30 16:40:55 +00:00
Joe Watkins cfa885830a Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Yet one attempt to mitigate the unzip error on AppVeyor
  Ensure SDK is checked out before asking for version
  Fix fetching the SDK version
  Fix SDK version comparison and add more verbosity
  Don't use the cache dependency, SDK version is handled in script
  Remove status check on the SDK repo and add version check
  Catch with the latest AppVeyor unzip errors
2017-10-30 14:16:16 +00:00
Fabien Villepinte a308000ff2 Fix bug #75464 Wrong reflection on SoapClient::__setSoapHeaders 2017-10-30 14:13:05 +00:00
Anatol Belski 7ea44da104 Yet one attempt to mitigate the unzip error on AppVeyor 2017-10-30 12:16:53 +01:00
Anatol Belski e305e8fb7a Ensure SDK is checked out before asking for version 2017-10-30 12:07:27 +01:00
Anatol Belski 7bf2947016 Fix fetching the SDK version 2017-10-30 11:28:32 +01:00
Anatol Belski c6e8c2bc9f Fix SDK version comparison and add more verbosity 2017-10-30 10:53:12 +01:00
Anatol Belski 591e811a35 Don't use the cache dependency, SDK version is handled in script 2017-10-30 10:34:11 +01:00
Anatol Belski bc410c2609 Remove status check on the SDK repo and add version check
If Appveyor fails to unzip, .git would be in an arbitrary state anyway.
Thus this check doesn't help. For the version check - rely on the branch
naming scheme in the SDK.
2017-10-30 10:14:05 +01:00
Anatol Belski 741efa7807 Catch with the latest AppVeyor unzip errors 2017-10-30 08:42:59 +01:00
Fabien Villepinte e6aea3dc78 Fix bug #75453 Incorrect reflection on ibase_connect and ibase_pconnect 2017-10-30 06:55:00 +00:00
Anatol Belski 123b1d79eb Re-enable AppVeyor cache 2017-10-29 10:08:31 +01:00
Joe Watkins 59d413ceb8 make sure run-tests reports exit status upon prerequisite error 2017-10-29 04:37:21 +00:00
Fabien Villepinte 938f256ed9 Fix bug #75434 Wrong reflection for mysqli_fetch_all function 2017-10-28 12:57:25 +02:00
Fabien Villepinte 51ea2cfbe1 Fix bug #75307 Wrong reflection for openssl_open function 2017-10-27 16:06:01 +01:00
Anatol Belski 15a71fe045 Skip test on PostgreSQL 10
The 42P18 error is not produced by the server anymore.
2017-10-27 16:19:42 +02:00
Anatol Belski 24b1bb0abd Fix test compat for PostgreSQL 10 2017-10-27 14:58:43 +02:00
Anatol Belski 10dc1950f7 Apply upstream patch for CVE-2017-14107 2017-10-27 13:20:15 +02:00
Anatol Belski f0a42d9fe4 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Backport and apply upstream patch for CVE-2017-14107
2017-10-27 13:18:41 +02:00
Anatol Belski f6e8ce8121 Backport and apply upstream patch for CVE-2017-14107 2017-10-27 13:16:56 +02:00
Anatol Belski 9eb6f86765 Binary SDK 2.0.12 stable 2017-10-26 21:25:08 +02:00
Dmitry Stogov 98eee90734 Fixed indirect modification of magic ArrayAccess method arguments 2017-10-26 16:03:42 +03:00
Dmitry Stogov 502cfddf28 Backport tests 2017-10-26 14:12:08 +03:00
Dmitry Stogov bc59289b7a Fixed indirect modification of magic method arguments. 2017-10-26 13:05:23 +03:00
Xinchen Hui eaeccc1d99 Fixed test 2017-10-26 10:23:43 +08:00
Xinchen Hui d2047503cb Fixed bug #75420 (Crash when modifing property name in __isset for BP_VAR_IS) 2017-10-26 10:07:08 +08:00
Fabien Villepinte 578ba71b3b Fix typo in comments 2017-10-25 20:59:40 +01:00
Fabien Villepinte e763a1cdc7 Fix the SKIPIF part in /ext/gd/tests/bug75437.phpt 2017-10-25 14:39:38 +02:00
Fabien Villepinte 0fbb9f343f Fix bug #75437 Wrong reflection on imagewebp 2017-10-25 12:54:05 +02:00
Ferenc Kovacs 9fbf13a496 Merge branch 'PHP-5.6' into PHP-7.0 2017-10-25 03:39:34 +02:00
Ferenc Kovacs f600785f65 5.6.33 is next 2017-10-25 03:36:30 +02:00
Ferenc Kovacs b53fb886a4 use trusty explicitly 2017-10-25 03:14:51 +02:00
Ferenc Kovacs 6125ce9d33 Merge branch 'PHP-5.6' into PHP-7.0 2017-10-25 03:13:40 +02:00
Rasmus Lerdorf ad7ed6fe21 These tests all assume that IPV6 is available. 2017-10-25 02:21:16 +02:00
Ferenc Kovacs 787e3a1ee4 fix the travis build for PHP-5.6 using precise instead of trusty 2017-10-25 01:51:48 +02:00
Ferenc Kovacs 9839d3a953 fix the travis build for PHP-5.6 using precise instead of trusty 2017-10-25 01:47:50 +02:00
Anatol Belski e19bf29b53 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Parametrize the expected value to avoid platform false positives
2017-10-24 18:36:56 +02:00
Anatol Belski 45ac5edbd9 Parametrize the expected value to avoid platform false positives 2017-10-24 18:33:21 +02:00
Sara Golemon 68e27b0763 Decref default_link when clearing 2017-10-24 11:37:59 -04:00
Christoph M. Becker 22c487616f Fixed bug #65148 (imagerotate may alter image dimensions)
We apply the respective patches from external libgd, work around the
still missing `gdImageClone()`, and fix the special cased rotation
routines according to Pierre's patch
(https://gist.github.com/pierrejoye/59d72385ed1888cf8894a7ed437235ae).

We also cater to bug73272.phpt whose result obviously changes a bit.
2017-10-24 17:02:56 +02:00
Derick Rethans 8e3260376c Update timezonemap.h, which needs to match the bundled TZ db 2017-10-24 14:55:13 +01:00
Anatol Belski 75d0ba5179 [ci skip] update NEWS 2017-10-24 14:18:59 +02:00
Anatol Belski fadcfc8149 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  [ci skip] update NEWS
2017-10-24 14:17:21 +02:00
Anatol Belski 7d06a5c89f [ci skip] update NEWS 2017-10-24 14:16:54 +02:00
Anatol Belski 968c8fc0d5 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #72535 arcfour encryption stream filter crashes php
2017-10-24 14:04:08 +02:00
Anatol Belski 37acebcc8c Fixed bug #72535 arcfour encryption stream filter crashes php 2017-10-24 13:59:18 +02:00
Anatol Belski 5efbcd1882 Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Fixed bug #75055 Out-Of-Bounds Read in timelib_meridian()
  Apply upstream patch for CVE-2016-1283
2017-10-24 13:38:48 +02:00
Anatol Belski a7815e63bd Fixed bug #75055 Out-Of-Bounds Read in timelib_meridian() 2017-10-24 11:28:17 +02:00
Anatol Belski d37658be6c Apply upstream patch for CVE-2016-1283
Fix bug #75207, see also
https://bugzilla.redhat.com/show_bug.cgi?id=1295385
https://vcs.pcre.org/pcre?view=revision&revision=1636

(cherry picked from commit d11fceab15)
2017-10-24 11:10:11 +02:00
Sara Golemon 9fca585488 NEWS entry for pg_close() fix 2017-10-23 14:55:32 -04:00
Sara Golemon a645af4456 Bugfix#75419 Fix clearing of default link during pg_close() 2017-10-23 14:44:00 -04:00
Derick Rethans b2dfcb30eb Updated to version 2017.3 (2017c) 2017-10-23 17:31:20 +01:00
Anatol Belski 1cb2079d6c Fix memory leak 2017-10-23 15:26:08 +02:00
Anatol Belski 9f00e26008 Renaming cache folder is not a solution, too. Disable cache for now. 2017-10-23 07:13:00 +02:00
Anatol Belski c9a14b3aee Revert "Rename build cache folder and separate sdk"
This reverts commit 58dd892156.
2017-10-23 07:12:33 +02:00
Anatol Belski 58dd892156 Rename build cache folder and separate sdk 2017-10-23 07:08:45 +02:00
Anatol Belski eead6bf97a Revert "Invalidate the whole cache when .appveyor.yml was changed"
This reverts commit 25d40602cb.
2017-10-23 07:05:48 +02:00
Anatol Belski 25d40602cb Invalidate the whole cache when .appveyor.yml was changed 2017-10-23 07:00:36 +02:00
Jakub Zelenka 34ed75fab7 Fix clean up for openssl_pkcs12_export_to_file_basic 2017-10-22 18:54:15 +01:00
Jelle van der Waa 314bef5d03 openssl: Fix openssl_pkcs12_export extracerts test
Fix the openssl_pkcs12_export testcase for extracerts, the 'extracerts'
option needs to be the key of the certificate value otherwise
openssl_pkcs12_export will ignore it.
2017-10-22 18:53:30 +01:00
Anatol Belski 1d781fbdb1 With ICU 58+, set the default restriction level to high
Further experiments show, that CJK scripts should be ok. If there are
any issues, the moderate level can still be set later.
2017-10-21 17:21:41 +02:00
Anatol Belski 44b3bc847b Reenable AppVeyor cache 2017-10-21 11:59:22 +02:00
Anatol Belski 0b71ae7a15 Disable AppVeyor cache to unlock build 2017-10-21 10:49:20 +02:00
Anatol Belski 5d85d967bd Rework these new tests to match with diffs in ICU 58, 59 and upcoming 60 2017-10-21 10:29:04 +02:00
Anatol Belski ede8cee9e6 [ci skip] Update NEWS 2017-10-20 20:46:42 +02:00
Anatol Belski f95063647c Fixed bug #73655 Spoofchecker::isSuspicious behavior change due to upstream changes
There are significant changes in the spoof checking reflecting
http://www.unicode.org/reports/tr39/tr39-15.html and relying on the
restriction levels. ICU 58+ removes WSC and MSC handling and otherwise
undergoes big changes in both code and data areas. Keep up with the
basic points for now, as we need to move forward and provide an
acceptable experience to PHP users linking to a newer ICU. The most
distros ATM don't provide ICU > 57.1, though. We'll need for sure to
keep up with the BC breach in ICU 58+ in possible further aspects.
2017-10-20 19:23:32 +02:00
Anatol Belski 2198d38cbc Add test for newer ICU version 2017-10-20 19:02:42 +02:00
Anatol Belski e02c41fc72 Further test fixes for ICU >= 58 2017-10-20 18:39:46 +02:00
Anatol Belski 7240d99838 Fix version checks in tests 2017-10-20 15:23:09 +02:00
Anatol Belski 877e0b04bc Sync some tests for compat with ICU 58.1+ 2017-10-20 13:55:32 +02:00
Anatol Belski 9071ff5c87 Add skip for incompatible ICU version 2017-10-20 11:27:54 +02:00
Nester 80c3b078b8 Fixed #75317 - UConverter::setDestinationEncoding changes source instead of destinatination 2017-10-19 12:02:22 +01:00
Peter Kokot aa143515d6 Update .editorconfig with some more configs
Added support for .awk, .w32, .bat, .mk, .frag, .m4, .sh, .php, .phpt,
and Markdown files based on the current most used coding style in the
php-src repository.
2017-10-19 11:53:37 +01:00
Ryan Volz 4e85dd0346 Escape newline on curl config.m4 2017-10-19 11:39:54 +01:00
Anatol Belski 5f7707cc8a Move to php-sdk-2.0.0beta3 for Appveyor
Supposed to fix sporadic tool crashes on the test image
2017-10-18 17:45:33 +02:00
Anatol Belski d82805f097 Backport 7ff13badda into 7.0+ 2017-10-18 16:02:56 +02:00
Anatol Belski 9891f11f84 One more folder to delete in AppVeyor image 2017-10-17 15:32:47 +02:00
Tianfang Yang f955cff54c Fixed valgrind issue 2017-10-16 19:20:24 -04:00
Tianfang Yang aad4544e95 Fixed valgrind issue 2017-10-16 19:16:30 -04:00
Anatol Belski 7778106f40 Move to next binary SDK version for AppVeyor 2017-10-16 18:05:56 +02:00
Dmitry Stogov 8bfe748fb0 Prevent crash on ext/pdo_mysql/tests/bug_39858.phpt when built with libmysql 2017-10-16 19:00:12 +03:00
Jakub Zelenka 999fe36d40 Properly fix #75363 and address some other leaks with cert 2017-10-15 20:25:58 +01:00
Jelle van der Waa 5acb8381b2 Fixed bug #53070 (enchant_broker_get_path crashes if no path is set)
enchant_broker_get_dict_path segfaults when the dict path is not setup,
instead of segfaulting return false instead.
2017-10-15 13:57:44 +02:00
Christoph M. Becker fb09021432 Fixed bug #75365 (Enchant still reports version 1.1.0)
Since Enchant is bundled, we make `PHP_ENCHANT_VERSION` an alias of
`PHP_VERSION` and also drop the rather meaningless revision hash from
the PHP info.
2017-10-15 13:19:17 +02:00
Xinchen Hui 816758eda2 Fixed bug #75287 (Builtin webserver crash after chdir in a shutdown function) 2017-10-15 10:28:28 +08:00
Dmitry Stogov 397f5cb687 Fixed bug #75368 (mmap/munmap trashing on unlucky allocations) 2017-10-13 13:56:06 +03:00
Bob Weinand a55af1e271 Fixed bug #75363 (openssl_x509_parse leaks memory) 2017-10-12 12:30:20 +02:00
Anatol Belski 23e97b0222 It looks like i should've taken joint response on ext/fileinfo long ago 2017-10-11 22:21:34 +02:00
Anatol Belski d432bdb4ab Put php-sdk-2.0.12beta1 for AppVeyor
Quite some tool upgrades there, especially re2c 1.0.2
2017-10-11 20:27:27 +02:00
Christoph M. Becker 787bf7eaf7 Merge branch 'pull-request/2798' into PHP-7.0
* pull-request/2798:
  Fix Bug #75299 Wrong reflection on inflate_init and inflate_add
2017-10-11 17:28:30 +02:00
Christoph M. Becker b497b6edf9 Merge branch 'pull-request/2799' into PHP-7.0
* pull-request/2799:
  Use PHP_VERSION for exif
2017-10-11 14:42:46 +02:00
Christoph M. Becker c8eccf8451 [ci skip] Add NEWS entry for bug #75349 2017-10-10 13:54:52 +02:00
Anatol Belski d1fc9b425f Fix re2c version detection 2017-10-10 10:52:52 +02:00
Anatol Belski 51658bac35 Move dev to 7.0.26 2017-10-10 08:26:04 +02:00
Anatol Belski f48abfa902 Fix array access on undeclared properties in DateInterval 2017-10-09 15:35:38 +02:00
Sara Golemon 843e492c68 Bugfix #74556 stream_socket_get_name() returns null bytes on MacOS 2017-10-07 10:08:34 -04:00
Christoph M. Becker ec3d864784 Fixed bug #75318 (The parameter of UConverter::getAliases() is not optional)
Of course, reflection has to know that as well.
2017-10-06 16:45:07 +02:00
Mathieu CARBONNEAUX 6b9ccda936 Fixed bug #75311 2017-10-05 12:24:57 +02:00
Peter Kokot 74124de048 Use PHP_VERSION for exif 2017-10-04 23:25:36 +02:00
Dmitry Stogov 1195de87ff Bumped ext/oci8 version 2017-10-04 09:56:25 +03:00
Dmitry Stogov ee50fcfa27 Merge branch 'oci8_fix' into PHP-7.0
* oci8_fix:
  Use dereferenced value
  Fixed compilation errors
  Restored code for BOOL variables
  Fixed few ext/oci8 bugs
2017-10-04 09:49:40 +03:00
Dmitry Stogov 24e595bf26 Use dereferenced value 2017-10-03 10:49:56 +03:00
Viktor Szépe e995b7e475 Typo in status.html
feet needs -> fit needs
2017-10-03 07:21:53 +01:00
Peter Kokot 6d1dd8b0af Fix bug #74905 2017-10-03 07:18:38 +01:00
Peter Kokot 7b248a1b32 Remove ident gitattribute for ext/zip/php_zip.c 2017-10-03 07:14:50 +01:00
Dmitry Stogov 4d69587035 Fixed compilation errors 2017-10-03 09:08:28 +03:00
Dmitry Stogov c8dea7ae1e Restored code for BOOL variables 2017-10-02 17:04:26 +03:00
Fabien Villepinte 9d9873b3b5 Fix Bug #75299 Wrong reflection on inflate_init and inflate_add 2017-10-01 11:27:16 +02:00
Andrea Faulds abefb6dfe7 Fix bug #75290 2017-09-29 21:38:08 +01:00
Anatol Belski d11fceab15 Apply upstream patch for CVE-2016-1283
Fix bug #75207, see also
https://bugzilla.redhat.com/show_bug.cgi?id=1295385
https://vcs.pcre.org/pcre?view=revision&revision=1636
2017-09-28 15:40:49 +02:00
Peter Kokot 29e673f8ed Fix CGI m4 config message when CGI is disabled 2017-09-27 06:20:09 +01:00
Peter Kokot 6d0391b1a4 Fix bug #75248 and #75251 2017-09-27 06:15:12 +01:00
Nester a680d701ce Fixed #75220 - Segfault when calling is_callable on parent 2017-09-27 06:07:24 +01:00
Peter Kokot 3752d18ffe Remove some old sapi/apache_hooks and sapi/apache leftovers 2017-09-25 21:56:39 +02:00
Xinchen Hui b05ff14a9a Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()). 2017-09-24 17:24:11 +08:00
Xinchen Hui db63367871 Compiler warning 2017-09-24 17:19:05 +08:00
Nikita Popov 73d6456d7d Fixed bug #75252 2017-09-24 08:53:27 +02:00
Anatol Belski da2f581833 Fix thread safety 2017-09-21 10:32:09 +02:00
Andrea Faulds 418f97443a Fix bug #75236 2017-09-21 00:02:52 +01:00
Dmitry Stogov 9a01fe712a Fixed few ext/oci8 bugs 2017-09-20 16:46:04 +03:00
Christoph M. Becker eedc060c92 Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags)
We must not overwrite the SPL_DLLIST_IT_FIX flag when changing the
iterator mode.
2017-09-20 15:46:04 +02:00
Anatol Belski 9641586efa Fix the version check causing the test fail 2017-09-18 12:04:31 +02:00
Anatol Belski 7670590efd Update lib_versions.txt 2017-09-18 09:34:58 +02:00
Anatol Belski 7910c1dee9 Move to next binary SDK version for AppVeyor 2017-09-15 23:04:15 +02:00
Dmitry Stogov d7a10f0e32 Properly update string type flags 2017-09-13 01:45:57 +03:00
Dmitry Stogov 83d8ebc991 Revert "Properly update string type flags"
This reverts commit 99b1a62d55.
2017-09-13 00:14:39 +03:00
Dmitry Stogov 2874fa8fb0 Fixed test 2017-09-12 23:47:22 +03:00
Dmitry Stogov 99b1a62d55 Properly update string type flags 2017-09-12 23:42:51 +03:00
Anatol Belski 7674b5e574 Fix test failure on 32-bit 2017-09-12 18:17:28 +02:00
Remi Collet 35deb4c88b drop symbol definition, and not defined anywhere 2017-09-12 13:03:18 +02:00
Anatol Belski 3d1cb7e32c [ci skip] update NEWS 2017-09-12 12:17:12 +02:00
Remi Collet b09497c0e2 Fixed bug #75193 segfault in collator_convert_object_to_string 2017-09-12 12:12:06 +02:00
Anatol Belski 5cf215536b Move dev to 7.0.25 2017-09-12 09:02:01 +02:00
Anatol Belski 194547f591 [ci skip] Fix news entry format 2017-09-12 08:35:10 +02:00
jhdxr 3e11b7fc21 fix bug #75173 incorrect behavior of AppendIterator::append in foreach loop 2017-09-12 07:05:58 +01:00
Christoph M. Becker 9aa6898b9b Fixed bug #46781 (BC math handles minus zero incorrectly)
Actually, there is no negative zero at all.  We obey Postel's law, and
still accept negative zeroes, but we store them as positive zeroes
after the conversion from string, i.e. we normalize before further
processing.
2017-09-11 23:44:23 +02:00
Anatol Belski d103802003 Fork test to keep up with libxsl >= 1.1.30
The behavior of date parsing has changed and is reflected in the
changelog. Invalid dates are not accepted, in particular dates with a
negative year, as in this test.
2017-09-11 18:14:51 +02:00
Anatol Belski 04a6bbae6c Add symbol to libxml exports 2017-09-11 17:35:25 +02:00
Anatol Belski cab41ecb93 Fix test compat with libxml2 2.9.5
One warning disappeared, but the flow is still valid.
2017-09-11 16:12:04 +02:00
Anatol Belski 3549d9184a Fix test compat with libxml2 2.9.5
From 2.9.5 on libxml explcitly initializes the keepBlanks flag.
2017-09-11 14:32:54 +02:00
Anatol Belski 5f9ae45e22 Fix test compatibility with libxml2 2.9.5 2017-09-11 12:12:19 +02:00
Christoph M. Becker 4b746fce1c Fixed bug #73730 (textdomain(null) throws in strict mode)
The $text_domain parameter may be NULL, which we have to cater to
explicitly with regard to strict_types.
2017-09-10 18:39:29 +02:00
Christoph M. Becker 3fd08a1595 Fix bug75178.phpt on Windows
bug75178.phpt fails on Windows, because the stderr output is not
interspersed with stdout output there, but rather is appended to the
end. The fix is analogous to bug72093.phpt.
2017-09-09 16:46:32 +02:00
Christoph M. Becker 44eec946e8 Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
Since `bcpowmod()` does not support non-integral operands, we have to
truncate these in addition to emitting a respective warning. We also
have to work with the truncated values in the following.

We recognize that the division by one to enforce the truncation is
actually overkill, but we stick with it for now, and shall tackle the
issue for PHP 7.3.
2017-09-09 13:18:26 +02:00
Sara Golemon 0413feb29c Add BC define for users of the typoed zend_symbtable_add_new 2017-09-07 17:35:54 -04:00
Sara Golemon f18cf46d07 Fix typo in zend_symtable_add_new() API name 2017-09-07 16:25:25 -04:00
Christoph M. Becker b2919853f8 Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1)
`x mod 1` is always zero; we have to take the scale into account,
though.
2017-09-07 00:30:05 +02:00
Christoph M. Becker dea41f3c3a Fixed bug #44995 (bcpowmod() fails if scale != 0)
`bc_divmod()` is supposed to do integer division, so we must not apply
a scale factor here.
2017-09-06 23:30:53 +02:00
Nikita Popov 42549b7844 Add missing null termination 2017-09-05 18:13:50 +02:00
Bouke van der Bijl cd9d90f4d4 Fixed bug #70470 2017-09-05 16:23:32 +02:00
Anatol Belski 24da62d342 Fix command 2017-09-02 16:56:52 +02:00
Christoph M. Becker e20a6b0213 Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?)
We back-port https://github.com/libgd/libgd/commit/dd48286 even though
we cannot come up with a regression test, because the erroneous
condition appears to be impossible to trigger.

We also parenthesize the inner ternary operation to avoid confusion.
2017-09-02 00:04:02 +02:00
Anatol Belski a86df6bcb0 Make for exclusion per regex 2017-08-31 23:56:42 +02:00
Anatol Belski 6ec494016b Extend ignore list for DLLs to not to look after
fix typo
2017-08-31 20:54:11 +02:00
Dylan K. Taylor 2e77f5eed3 Fix nmake install fails when there are no shared extensions
check for existence instead of muting everything

check for exe existence before trying to copy
2017-08-31 20:32:36 +02:00
Dylan K. Taylor 4e9c3e9396 Copy dependencies of the core DLL in nmake snap for statically-compiled extensions when packaging builds 2017-08-31 19:46:47 +02:00
Remi Collet 3239f6d679 move AC_DEFINE in the right position (in bundled lib conditon) 2017-08-31 07:55:45 +02:00
Anatol Belski 0966f9de41 Move to next bin SDK version for AppVeyor 2017-08-28 13:12:51 +02:00
Christoph M. Becker 499f5480f1 Fixed bug #75124 (gdImageGrayScale() may produce colors)
We have to make sure to avoid alpha-blending issues by explicitly
switching to `gdEffectReplace` and to restore the old value afterwards.

This is a port of <https://github.com/libgd/libgd/commit/a7a7ece>.
2017-08-27 13:53:39 +02:00
Thomas Punt be9edd83c2 Fixed bug #75090 2017-08-25 22:02:19 +02:00
Anatol Belski 55db2c31cd update libs versions 2017-08-25 11:28:12 +02:00
Remi Collet b7e96f8e0e From documentation, only the sign of returned value is relevant
With recent glibc, memcmp sometime return a negative value instead of -1
2017-08-24 10:27:38 +02:00
Tianfang Yang 4bf1a11c07 Merge branch 'pull-request/2534' into PHP-7.0
* pull-request/2534:
  Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized before PHP-FPM sets it up)
2017-08-22 01:10:58 -04:00
Ingmar Runge 079bc324cd Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized before PHP-FPM sets it up) 2017-08-22 01:09:35 -04:00
Andrea Faulds 61538ebadc Fixed bug #75097 (gethostname fails if your host name is 64 chars long)
PHP contained two different off-by-one errors, which are fixed here. First,
it created a buffer of size HOST_NAME_MAX, not adding space for a null
terminator. Second, it subtracted 1 from the size of that buffer when passing
its size to gethostname(), despite gethostname() expecting it to be a buffer
size including space for a terminating null byte, not a string length.
2017-08-19 20:31:54 +01:00
Anatol Belski 3cad07b84f [ci skip] update NEWS 2017-08-19 02:40:17 +02:00
John Boehr 71b12940d0 Fix issues with phpt and EXTENSION on windows (BUG 75042)
* Commands are not properly escaped for windows
* Specifying "-n" to check loaded modules causes "Module already loaded"
warning
* Extensions to be loaded need the "php_" prefix on Windows

Bug: https://bugs.php.net/bug.php?id=75042

Add back -n flag to fetch loaded extensions in run-tests.php

Add test for phpt EXTENSIONS directive

Add a second test for bug 75042

Add test to test loading of nonexistent shared module

with the EXTENSIONS phpt block

Pass ini settings when checking loaded extensions

Fix skipifs
2017-08-19 01:59:48 +02:00
Anatol Belski ba59b6f11b Fix .pgd name for ts build 2017-08-19 00:31:04 +02:00
Remi Collet b28912b0f7 NEWS 2017-08-18 14:52:11 +02:00
Remi Collet a7594cb74f Fixed bug #75093 OpenSSL support not detected 2017-08-18 14:51:44 +02:00
Anatol Belski 065551bc9c Fix phpize exit status
Configure and others are generated, not copied. Seems there's yet much
more to do wrt exit status catching.
2017-08-18 11:54:56 +02:00
Anatol Belski e7f4e67155 Add dump env target 2017-08-18 11:08:27 +02:00
Derick Rethans 60a6feed07 Revert "Upgrade timelib to 2017.05beta7"
This reverts commit bdd56f3107.
2017-08-16 15:19:18 +01:00
Derick Rethans 8af70958fc Revert "Remove removed header files from configuration files."
This reverts commit 3df753c6ca.
2017-08-16 15:19:11 +01:00
Derick Rethans 5d2c303438 Fixed stupid test 2017-08-16 11:14:41 +01:00
Derick Rethans 7829f9b1d2 Added timelib version to phpinfo() 2017-08-16 09:51:21 +01:00
Remi Collet 01735f4d9f cleanup 2017-08-16 07:46:07 +02:00
Derick Rethans 3df753c6ca Remove removed header files from configuration files. 2017-08-15 20:22:41 +01:00
Derick Rethans bdd56f3107 Upgrade timelib to 2017.05beta7 2017-08-15 14:10:23 +01:00
Anatol Belski 3af6201224 move dev to 7.0.24 2017-08-15 09:33:30 +02:00
Xinchen Hui d8c80af71e Fixed bug #75075 (unpack with X* causes infinity loop) 2017-08-15 12:34:13 +08:00
Tianfang Yang 2def85688d Merge branch 'syncoci8' into PHP-7.0 2017-08-14 21:16:34 -04:00
Tianfang Yang 259477826c Prepare for PECL release 2017-08-14 21:14:14 -04:00
Anatol Belski ab07265573 Test cleanup improvements, files might be locked in the test process 2017-08-14 13:08:04 +02:00
Anatol Belski 71fd58652f fix test cleanup 2017-08-14 12:55:14 +02:00
Tianfang Yang f555224743 Sync OCI8 on PHP 7.x branches 2017-08-13 23:44:24 -04:00
Christoph M. Becker f64be0b013 Fixed bug #73793 (WDDX uses wrong decimal seperator)
The WDDX specification[1] requires to serialize floats with a decimal
point, but `snprintf()` is locale-dependent and may use a decimal
comma. We fix that afterwards by replacing an eventual comma with a
point.

[1] <http://xml.coverpages.org/wddx0090-dtd-19980928.txt>
2017-08-13 20:51:53 +02:00
Christoph M. Becker 472b25921e Skip this test if ext/session is not available 2017-08-13 18:05:45 +02:00
Nikita Popov 1a23ebc1ff Fixed bug #74103 and bug #75054
Directly fail unserialization when trying to acquire an r/R
reference to an UNDEF HT slot. Previously this left an UNDEF and
later deleted the index/key from the HT.

What actually caused the issue here is a combination of two
factors: First, the key deletion was performed using the hash API,
rather than the symtable API, such that the element was not actually
removed if it used an integral string key. Second, a subsequent
deletion operation, while collecting trailing UNDEF ranges, would
mark the element as available for reuse (leaving a corrupted HT
state with nNumOfElemnts > nNumUsed).

Fix this by failing early and dropping the deletion code.
2017-08-12 13:11:35 +02:00
Andrea Faulds b59718bdc4 Fix bug #74725 (html_errors=1 breaks unhandled exceptions) 2017-08-12 01:37:20 +01:00
Xinchen Hui b06f8cb58b Fixed bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results) 2017-08-09 11:28:53 +08:00
Anatol Belski afb20f4895 Remove mistakingly added line 2017-08-08 19:37:55 +02:00
Anatol Belski 075986f214 Sync makefile options for phpize
- run target
- debugger mode
2017-08-08 17:58:10 +02:00
Darek Slusarczyk 618dcd6520 JSON: fix config.w32 / Install headers on windows 2017-08-08 15:52:53 +02:00
Anatol Belski 4c9fe5a490 Unify EOL 2017-08-07 17:03:17 +02:00
Anatol Belski d058e30917 fix test target for phpize 2017-08-07 16:45:02 +02:00
Remi Collet 159e5c1048 use AC_DEFINE + win32 2017-08-04 13:21:28 +02:00
Anatol Belski 9689796c10 Increase expected timing on Travis
If 5ms to read/write 8 bytes still has issue, probably next this test
should skip on Travis to avoid false positive fails.
2017-08-03 15:05:22 +02:00
Anatol Belski 9ba2cfd33e update NEWS 2017-08-02 21:49:21 +02:00
Andreas Treichel c2b8066efb Bug #74975: Different serialization for classes 2017-08-02 18:49:26 +02:00
Nikita Popov 9ca1b2a775 Merge remote-tracking branch 'php-src/PHP-7.0' into PHP-7.0 2017-08-02 18:16:18 +02:00
Fabien Villepinte 2cc1cbf2f4 Fix Bug #75001: Wrong reflection on mb_eregi_replace 2017-08-02 18:08:42 +02:00
Fabien Villepinte 15abb2b56e Fix test transliterator_create_inverse_basic.phpt 2017-08-02 18:04:43 +02:00
George Wang e78712791d take care of compile warnings. 2017-08-02 11:59:41 -04:00
Derick Rethans b112d09013 Fixed bug #75002 Null Pointer Dereference in timelib_time_clone 2017-08-02 16:40:48 +02:00
Remi Collet 666cb6c802 fix build with old system libsqlite (sqlite3_errstr may be missing) 2017-08-02 14:01:56 +02:00
clwu b2934d2612 fixed #endif comments 2017-08-02 08:35:27 +01:00
Julien Pauli 0c0cbb43da Updated NEWS 2017-08-01 16:01:43 +02:00
Julien Pauli 64e6ddc7f7 Fix #75015. Crash in SPL destructors 2017-08-01 15:59:54 +02:00
Anatol Belski a8e25fdbf8 Test to cover the change in ce1a0d97 2017-08-01 12:49:45 +02:00
Christoph M. Becker 2d96fdd54f Shrink another large image
This image is only used for testing `BITMAPV5HEADER` support in
`getimagesize()` (see bf9ad4e). Therefore it is not necessary to have
a big image; a single pixel is sufficient.
2017-07-30 16:26:06 +02:00
Christoph M. Becker 74a696d53b Shrink test image
The last (`IDAT`) chunk in this file starting at `0x5e265` reports to
have a length of `0x2000` bytes, but there are only `0x1D9B` bytes
left. Simply cutting the first `IDAT` chunk which starts at `0x31` and
also reports a length of `0x2000` at the same offset should produce the
same test results (while reducing the file size to 7.628 bytes).
2017-07-30 14:43:37 +02:00
Christoph M. Becker 4d6f808c16 Skip this test if ext/gd is not available 2017-07-30 13:24:10 +02:00
Nikita Popov e3d25e78eb Fixed bug #62934 2017-07-28 13:02:25 +02:00
Anatol Belski b01336814d relax test on travis 2017-07-28 00:27:11 +02:00
Pedro Magalhães 34e5d3a87d Simpler fix for #74974 2017-07-27 09:25:38 -04:00
Xinchen Hui 9fcfe52d03 Fixed test 2017-07-27 12:50:17 +08:00
Xinchen Hui e36c04ef48 Fixed bug #74949 (null pointer dereference in _function_string) 2017-07-27 11:23:06 +08:00
Sara Golemon c7aa8ba0ee Bugfix #74993 Wrong reflection param into for some intl: lookup_*() methods 2017-07-26 18:55:23 -04:00
Anatol Belski 3306b3aa60 [ci skip] update NEWS 2017-07-26 17:29:37 +02:00
Anatol Belski bd00fe81cc Fixed bug #74833, SID constant created with wrong module number 2017-07-26 13:19:41 +02:00
Benjamin W. Broersma 6b1fbafdf0 Fix bug #74991 - include_path has a 4096 char (minus "__DIR__:") limit, in some PHAR cases 2017-07-26 10:46:50 +01:00
Christopher Jones de65a2243f Expose oci_unregister_taf_callback() 2017-07-26 15:22:44 +10:00
Carsten Brandt 3fd7d819b8 Fixed finding CURL on systems with multiarch support
fixes https://bugs.php.net/bug.php?id=74125

This commit makes the cURL config script aware of debian/ubuntu
[multiarch support][1] which installs architecture specific
headers in a different location.

It checks whether the `dpkg-architecture` script exists and is
executeable, if that is the case, the multiarch architecture is
detected by calling `dpkg-architecture -qDEB_HOST_MULTIARCH` as
documented in [debian multiarch implementation docs][2]:

> `/usr/include/<triplet>`: used for arch-varying headers

[1]: https://wiki.debian.org/Multiarch
[2]: https://wiki.debian.org/Multiarch/Implementation
2017-07-25 06:58:11 +01:00
Joe Watkins 69b48f83df minor loop optimizations, closes #2633 2017-07-25 06:47:58 +01:00
Anatol Belski cdf9178c43 switch to binary sdk 2.0.9 for appveyor 2017-07-24 23:07:15 +02:00
Peter Kokot 924ff6164e Update copyright year to 2017 2017-07-24 17:23:57 +01:00
Anatol Belski a769d873f8 Add test for bug #74903 2017-07-24 17:02:10 +02:00
Jelle van der Waa 23c124ec75 openssl: Add openssl_pkcs12_export_to_file tests
Add basic tests for openssl_pkcs12_export_to_file.
2017-07-24 10:46:42 +01:00
Peter Kokot c4e11c8ef3 Update PHP 5 version to 7 in header comments 2017-07-24 10:42:15 +01:00
Christoph M. Becker 418da85f15 Fix #71606: Segmentation fault mb_strcut with HTML-ENTITIES
The HTML decoding filter uses the `opaque` member of mbfl_convert_filter
as buffer, but there was no copy constructor defined, what caused double
frees when the filter is copied (what happens multiple times in mb_strcut(),
for instance).
2017-07-23 12:19:27 +02:00
Sara Golemon 775b4b54d8 Use compatability zend_isnan() instead of POSIX isnan()
s/isnan/zend_isnan/g
2017-07-22 21:32:44 -04:00
Sara Golemon c562d44321 Fix compile-time optimization of NAN comparisons 2017-07-22 21:22:51 -04:00
Anatol Belski ad12da4908 [ci skip] update NEWS 2017-07-22 14:12:45 +02:00
Bob Weinand bad5d0d6c5 Fixed bug #74954 (null deref and segfault in zend_generator_resume()) 2017-07-22 11:14:00 +02:00
Anatol Belski e405ff59f9 Fixed bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class 2017-07-22 10:35:26 +02:00
Xinchen Hui 256ec5bebb Merge branch 'PHP-7.0' of git.php.net:/php-src into PHP-7.0
* 'PHP-7.0' of git.php.net:/php-src:
  Move the define into the header to reduce diff for future upgrade
2017-07-21 18:16:37 +08:00
Xinchen Hui 3a7b0027f3 Fixed bug #74950 (nullpointer deref in simplexml_element_getDocNamespaces) 2017-07-21 18:16:11 +08:00
Anatol Belski 9b3c26d4f4 Move the define into the header to reduce diff for future upgrade 2017-07-21 09:12:06 +02:00
Xinchen Hui 95d2908814 Fixed bug #74947 (Segfault in scanner on INF number) 2017-07-21 11:56:49 +08:00
Anatol Belski ce06677069 increment sdk version 2017-07-20 22:06:34 +02:00
Anatol Belski ecad9a470f remove another cygwin instance in AppVeyor run 2017-07-20 20:39:04 +02:00
Anatol Belski f67a3cc9bd fix dir separator in test 2017-07-19 22:41:09 +02:00
Sara Golemon c9fd093127 Do not allow using traits/interfaces/abstract classes as stream wrappers
Fixes https://bugs.php.net/bug.php?id=74951
2017-07-19 14:00:00 -04:00
Lior Kaplan 2cca43b3ab Add oci8_failover.c to config.w32, follow up for commit 1b797f7a 2017-07-19 17:23:22 +03:00
Dmitry Stogov e5beb4e828 Reset globals on startup or restart 2017-07-19 15:35:10 +03:00
andrewnester afc22828ea Fixed #74699 - Broken ArrayIterator unserializing 2017-07-18 22:14:11 +02:00
YaoGuai 51cdd3dc50 Fix check of mysql_commit() return value
For mysql_commit() everything non-zero is an error.
2017-07-18 21:45:02 +02:00
Anatol Belski 0da10134f2 Exclude ext/ftp from AppVeyor test run
as the tests depend on fork() and otherwise an extra setup would be
needed anyway.
2017-07-18 12:08:31 +02:00
Anatol Belski 649027b963 move to 7.0.23 for dev 2017-07-18 10:25:40 +02:00
311 changed files with 8969 additions and 4508 deletions

No files matched your search

+1 -2
View File
@@ -18,13 +18,12 @@ clone_depth: 64
cache:
- c:\build-cache
- c:\build-cache\sdk -> .appveyor.yml
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.7
PHP_BUILD_SDK_BRANCH: php-sdk-2.0.13
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
#MYSQL_TEST_USER: root
+25 -6
View File
@@ -1,16 +1,35 @@
; http://editorconfig.org/
# http://editorconfig.org/
root = true
[*.{c,h}]
charset = UTF-8
end_of_line = LF
[*.{c,h,awk,w32,bat,mk,frag}]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true
insert_final_newline = true
[*.yml]
[*.{php,phpt}]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.{yml,m4,sh}]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
charset = utf-8
end_of_line = lf
indent_style = space
trim_trailing_whitespace = false
insert_final_newline = true
-4
View File
@@ -15,11 +15,8 @@ ext/dba/libflatfile/flatfile.c ident
ext/dba/libcdb/cdb_make.c ident
ext/dba/libcdb/cdb.c ident
ext/filter/filter.c ident
ext/zip/php_zip.c ident
README.input_filter ident
run-tests.php ident
sapi/nsapi/nsapi.c ident
sapi/continuity/capi.c ident
Zend/RFCs/002.txt ident
Zend/RFCs/003.txt ident
ext/exif/exif.c ident
@@ -32,7 +29,6 @@ UPGRADING.INTERNALS merge=NEWS
/ext/bz2/tests/with_strings.phpt -crlf
/ext/dom/tests/bug40836.phpt -crlf
/ext/dom/tests/domelement.phpt -crlf
/ext/ereg/tests/eregi_basic_002.phpt -crlf
/ext/iconv/tests/iconv004.phpt -crlf
/ext/iconv/tests/iconv_basic.phpt -crlf
/ext/iconv/tests/iconv_strpos.phpt -crlf
-2
View File
@@ -262,9 +262,7 @@ pear/phpize
pear/run-tests
pear/php-config
pear/scripts
sapi/apache/libphp7.module
sapi/apache2handler/libphp7.module
sapi/apache_hooks/libphp7.module
sapi/cgi/php-cgi
sapi/cgi/php-cgi.1
sapi/cli/php.1
+1
View File
@@ -1,3 +1,4 @@
dist: trusty
language: c
sudo: false
addons:
+1 -1
View File
@@ -47,7 +47,7 @@ MAINTENANCE: Maintained
STATUS: Working
-------------------------------------------------------------------------------
EXTENSION: fpm
PRIMARY MAINTAINER: Antony Dovgal <tony2001@php.net>, Jerome Loyet <fat@php.net>
PRIMARY MAINTAINER: Jakub Zelenka <bukka@php.net>
MAINTENANCE: Maintained
STATUS: Working
SINCE: 5.3.3
+4 -4
View File
@@ -5,7 +5,7 @@ INSTALL_DATA = $(INSTALL) -m 644
DEFS = -DPHP_ATOM_INC -I$(top_builddir)/include -I$(top_builddir)/main -I$(top_srcdir)
COMMON_FLAGS = $(DEFS) $(INCLUDES) $(EXTRA_INCLUDES) $(CPPFLAGS) $(PHP_FRAMEWORKPATH)
all: $(all_targets)
all: $(all_targets)
@echo
@echo "Build complete."
@echo "Don't forget to run 'make test'."
@@ -112,13 +112,13 @@ test: all
clean:
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
distclean: clean
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h sapi/apache/libphp$(PHP_MAJOR_VERSION).module sapi/apache_hooks/libphp$(PHP_MAJOR_VERSION).module buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
rm -f Makefile config.cache config.log config.status Makefile.objects Makefile.fragments libtool main/php_config.h main/internal_functions_cli.c main/internal_functions.c stamp-h buildmk.stamp Zend/zend_dtrace_gen.h Zend/zend_dtrace_gen.h.bak Zend/zend_config.h TSRM/tsrm_config.h
rm -f php7.spec main/build-defs.h scripts/phpize
rm -f ext/date/lib/timelib_config.h ext/mbstring/oniguruma/config.h ext/mbstring/libmbfl/config.h ext/oci8/oci8_dtrace_gen.h ext/oci8/oci8_dtrace_gen.h.bak
rm -f scripts/man1/phpize.1 scripts/php-config scripts/man1/php-config.1 sapi/cli/php.1 sapi/cgi/php-cgi.1 ext/phar/phar.1 ext/phar/phar.phar.1
@@ -135,7 +135,7 @@ prof-gen:
prof-clean:
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
rm -f libphp$(PHP_MAJOR_VERSION).la $(SAPI_CLI_PATH) $(SAPI_CGI_PATH) $(SAPI_MILTER_PATH) $(SAPI_LITESPEED_PATH) $(SAPI_FPM_PATH) $(OVERALL_TARGET) modules/* libs/*
+256
View File
@@ -1,5 +1,260 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
29 Mar 2018 PHP 7.0.29
- FPM:
. Fixed bug #75605 (Dumpable FPM child processes allow bypassing opcache
access controls). (Jakub Zelenka)
01 Mar 2018 PHP 7.0.28
- Standard:
. Fixed bug #75981 (stack-buffer-overflow while parsing HTTP response). (Stas)
04 Jan 2018 PHP 7.0.27
- CLI Server:
. Fixed bug #60471 (Random "Invalid request (unexpected EOF)" using a router
script). (SammyK)
- Core:
. Fixed bug #75384 (PHP seems incompatible with OneDrive files on demand).
(Anatol)
. Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26). (Laruence)
- FPM:
. Fixed bug #64938 (libxml_disable_entity_loader setting is shared between
requests). (Remi)
- GD:
. Fixed bug #75571 (Potential infinite loop in gdImageCreateFromGifCtx). (cmb)
- Opcache:
. Fixed bug #75579 (Interned strings buffer overflow may cause crash).
(Dmitry)
- PCRE:
. Fixed bug #74183 (preg_last_error not returning error code after error).
(Andrew Nester)
- Phar:
. Fixed bug #74782 (Reflected XSS in .phar 404 page). (Stas)
- Standard:
. Fixed bug #75535 (Inappropriately parsing HTTP response leads to PHP
segment fault). (Nikita)
. Fixed bug #75409 (accept EFAULT in addition to ENOSYS as indicator
that getrandom() is missing). (sarciszewski)
- Zip:
. Fixed bug #75540 (Segfault with libzip 1.3.1). (Remi)
23 Nov 2017 PHP 7.0.26
- Core:
. Fixed bug #75420 (Crash when modifing property name in __isset for
BP_VAR_IS). (Laruence)
. Fixed bug #75368 (mmap/munmap trashing on unlucky allocations). (Nikita,
Dmitry)
- CLI:
. Fixed bug #75287 (Builtin webserver crash after chdir in a shutdown
function). (Laruence)
- Enchant:
. Fixed bug #53070 (enchant_broker_get_path crashes if no path is set). (jelle
van der Waa, cmb)
. Fixed bug #75365 (Enchant still reports version 1.1.0). (cmb)
- Exif:
. Fixed bug #75301 (Exif extension has built in revision version). (Peter
Kokot)
- GD:
. Fixed bug #65148 (imagerotate may alter image dimensions). (cmb)
. Fixed bug #75437 (Wrong reflection on imagewebp). (Fabien Villepinte)
- intl:
. Fixed bug #75317 (UConverter::setDestinationEncoding changes source instead
of destination). (andrewnester)
- interbase:
. Fixed bug #75453 (Incorrect reflection for ibase_[p]connect). (villfa)
- Mysqli:
. Fixed bug #75434 (Wrong reflection for mysqli_fetch_all function). (Fabien
Villepinte)
- OCI8:
. Fixed valgrind issue. (Tianfang Yang)
- Opcache:
. Fixed bug #75373 (Warning Internal error: wrong size calculation). (Laruence, Dmitry)
- OpenSSL:
. Fixed bug #75363 (openssl_x509_parse leaks memory). (Bob, Jakub Zelenka)
. Fixed bug #75307 (Wrong reflection for openssl_open function). (villfa)
- PGSQL:
. Fixed bug #75419 (Default link incorrectly cleared/linked by pg_close()). (Sara)
- SOAP:
. Fixed bug #75464 (Wrong reflection on SoapClient::__setSoapHeaders). (villfa)
- Zlib:
. Fixed bug #75299 (Wrong reflection on inflate_init and inflate_add). (Fabien
Villepinte)
26 Oct 2017 PHP 7.0.25
- Core:
. Fixed bug #75241 (Null pointer dereference in zend_mm_alloc_small()).
(Laruence)
. Fixed bug #75236 (infinite loop when printing an error-message). (Andrea)
. Fixed bug #75252 (Incorrect token formatting on two parse errors in one
request). (Nikita)
. Fixed bug #75220 (Segfault when calling is_callable on parent).
(andrewnester)
. Fixed bug #75290 (debug info of Closures of internal functions contain
garbage argument names). (Andrea)
- Apache2Handler:
. Fixed bug #75311 (error: 'zend_hash_key' has no member named 'arKey' in
apache2handler). (mcarbonneaux)
- Date:
. Fixed bug #75055 (Out-Of-Bounds Read in timelib_meridian()). (Derick)
- Intl:
. Fixed bug #75318 (The parameter of UConverter::getAliases() is not
optional). (cmb)
- mcrypt:
. Fixed bug #72535 (arcfour encryption stream filter crashes php). (Leigh)
- OCI8:
. Fixed incorrect reference counting. (Dmitry, Tianfang Yang)
- PCRE:
. Fixed bug #75207 (applied upstream patch for CVE-2016-1283). (Anatol)
- litespeed:
. Fixed bug #75248 (Binary directory doesn't get created when building
only litespeed SAPI). (petk)
. Fixed bug #75251 (Missing program prefix and suffix). (petk)
- SPL:
. Fixed bug #73629 (SplDoublyLinkedList::setIteratorMode masks intern flags).
(J. Jeising, cmb)
28 Sep 2017 PHP 7.0.24
- Core:
. Fixed bug #75042 (run-tests.php issues with EXTENSION block). (John Boehr)
- BCMath:
. Fixed bug #44995 (bcpowmod() fails if scale != 0). (cmb)
. Fixed bug #46781 (BC math handles minus zero incorrectly). (cmb)
. Fixed bug #54598 (bcpowmod() may return 1 if modulus is 1). (okano1220, cmb)
. Fixed bug #75178 (bcpowmod() misbehaves for non-integer base or modulus). (cmb)
- CLI server:
. Fixed bug #70470 (Built-in server truncates headers spanning over TCP
packets). (bouk)
- CURL:
. Fixed bug #75093 (OpenSSL support not detected). (Remi)
- GD:
. Fixed bug #75124 (gdImageGrayScale() may produce colors). (cmb)
. Fixed bug #75139 (libgd/gd_interpolation.c:1786: suspicious if ?). (cmb)
- Gettext:
. Fixed bug #73730 (textdomain(null) throws in strict mode). (cmb)
- Intl:
. Fixed bug #75090 (IntlGregorianCalendar doesn't have constants from parent
class). (tpunt)
. Fixed bug #75193 (segfault in collator_convert_object_to_string). (Remi)
- PDO_OCI:
. Fixed bug #74631 (PDO_PCO with PHP-FPM: OCI environment initialized
before PHP-FPM sets it up). (Ingmar Runge)
- SPL:
. Fixed bug #75173 (incorrect behavior of AppendIterator::append in foreach loop).
(jhdxr)
- Standard:
. Fixed bug #75097 (gethostname fails if your host name is 64 chars long). (Andrea)
31 Aug 2017 PHP 7.0.23
- Core:
. Fixed bug #74947 (Segfault in scanner on INF number). (Laruence)
. Fixed bug #74954 (null deref and segfault in zend_generator_resume()). (Bob)
. Fixed bug #74725 (html_errors=1 breaks unhandled exceptions). (Andrea)
. Fixed bug #75349 (NAN comparison). (Sara)
- cURL:
. Fixed bug #74125 (Fixed finding CURL on systems with multiarch support).
(cebe)
- Date:
. Fixed bug #75002 (Null Pointer Dereference in timelib_time_clone). (Derick)
- Intl:
. Fixed bug #74993 (Wrong reflection on some locale_* functions). (Sara)
- Mbstring:
. Fixed bug #71606 (Segmentation fault mb_strcut with HTML-ENTITIES encoding).
(cmb)
. Fixed bug #62934 (mb_convert_kana() does not convert iteration marks).
(Nikita)
. Fixed bug #75001 (Wrong reflection on mb_eregi_replace). (Fabien
Villepinte)
- MySQLi:
. Fixed bug #74968 (PHP crashes when calling mysqli_result::fetch_object with
an abstract class). (Anatol)
- OCI8:
. Expose oci_unregister_taf_callback() (Tianfang Yang)
- phar:
. Fixed bug #74991 (include_path has a 4096 char limit in some cases).
(bwbroersma)
- Reflection:
. Fixed bug #74949 (null pointer dereference in _function_string). (Laruence)
- Session:
. Fixed bug #74833 (SID constant created with wrong module number). (Anatol)
- SimpleXML:
. Fixed bug #74950 (nullpointer deref in simplexml_element_getDocNamespaces).
(Laruence)
- SPL:
. Fixed bug #75049 (spl_autoload_unregister can't handle
spl_autoload_functions results). (Laruence)
. Fixed bug #74669 (Unserialize ArrayIterator broken). (Andrew Nester)
. Fixed bug #75015 (Crash in recursive iterator destructors). (Julien)
- Standard:
. Fixed bug #75075 (unpack with X* causes infinity loop). (Laruence)
. Fixed bug #74103 (heap-use-after-free when unserializing invalid array
size). (Nikita)
. Fixed bug #75054 (A Denial of Service Vulnerability was found when
performing deserialization). (Nikita)
- WDDX:
. Fixed bug #73793 (WDDX uses wrong decimal seperator). (cmb)
- XMLRPC:
. Fixed bug #74975 (Incorrect xmlrpc serialization for classes with declared
properties). (blar)
03 Aug 2017 PHP 7.0.22
- Core:
@@ -525,6 +780,7 @@ PHP NEWS
- JSON:
. Fixed bug #73526 (php_json_encode depth issue). (Jakub Zelenka)
. Install headers on windows. (Darek Slusarczyk)
- Mysqlnd:
. Fixed bug #64526 (Add missing mysqlnd.* parameters to php.ini-*). (cmb)
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #74947 (Segfault in scanner on INF number)
--FILE--
<?php
echo 200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
echo -200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000;
?>
--EXPECTF--
INF-INF
+13
View File
@@ -0,0 +1,13 @@
--TEST--
Bug #75241 (Null pointer dereference in zend_mm_alloc_small())
--FILE--
<?php
function eh(){}
set_error_handler('eh');
$d->d = &$d + $d->d/=0;
var_dump($d);
?>
--EXPECT--
float(INF)
+28
View File
@@ -0,0 +1,28 @@
--TEST--
Bug #75252: Incorrect token formatting on two parse errors in one request
--FILE--
<?php
$code = <<<'CODE'
function test_missing_semicolon() : string {
$x = []
FOO
}
CODE;
try {
eval($code);
} catch (ParseError $e) {
var_dump($e->getMessage());
}
try {
eval($code);
} catch (ParseError $e) {
var_dump($e->getMessage());
}
?>
--EXPECT--
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
string(41) "syntax error, unexpected 'FOO' (T_STRING)"
+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #75290 (debug info of Closures of internal functions contain garbage argument names)
--FILE--
<?php
var_dump((new ReflectionFunction('sin'))->getClosure());
var_dump(function ($someThing) {});
?>
--EXPECT--
object(Closure)#2 (1) {
["parameter"]=>
array(1) {
["$number"]=>
string(10) "<required>"
}
}
object(Closure)#2 (1) {
["parameter"]=>
array(1) {
["$someThing"]=>
string(10) "<required>"
}
}
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #75420.1 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump($obj->$name ?? 12);
var_dump($name);
?>
--EXPECT--
string(3) "foo"
int(42)
int(24)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #75420.10 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
var_dump($obj[$name] ?? 12);
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
int(42)
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.11 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
var_dump(empty($obj[$name]));
var_dump($name);
?>
--EXPECT--
string(3) "foo"
bool(false)
int(24)
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #75420.12 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
var_dump(empty($obj[$name]));
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
bool(false)
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.13 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
var_dump($obj[$name] ?? 12);
var_dump($obj);
?>
--EXPECT--
string(3) "foo"
int(42)
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.14 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["obj"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
var_dump(empty($obj[$name]));
var_dump($obj);
?>
--EXPECT--
string(3) "foo"
bool(false)
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.15 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { }
public function offsetGet($x) { }
public function offsetSet($x, $y) { $GLOBALS["name"] = 24; var_dump($x); }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
$obj[$name] = 1;
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.16 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { }
public function offsetGet($x) { }
public function offsetSet($x, $y) { $GLOBALS["obj"] = 24; var_dump($this); }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
$obj[$name] = 1;
var_dump($obj);
?>
--EXPECT--
object(Test)#1 (0) {
}
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.2 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
var_dump($obj->$name ?? 12);
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
int(42)
int(24)
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #75420.3 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump(empty($obj->$name));
var_dump($name);
?>
--EXPECT--
string(3) "foo"
bool(false)
int(24)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #75420.4 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
var_dump(empty($obj->$name));
?>
--EXPECT--
string(6) "foofoo"
bool(false)
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #75420.5 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
public function __get($x) { var_dump($this); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump($obj->$name ?? 12);
var_dump($obj);
?>
--EXPECT--
object(Test)#1 (0) {
}
int(42)
int(24)
+19
View File
@@ -0,0 +1,19 @@
--TEST--
Bug #75420.6 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["obj"] = 24; return true; }
public function __get($x) { var_dump($this); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump(empty($obj->$name));
var_dump($obj);
?>
--EXPECT--
object(Test)#1 (0) {
}
bool(false)
int(24)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #75420.7 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __set($x,$v) { $GLOBALS["name"] = 24; var_dump($x); }
}
$obj = new Test;
$name = "foo";
$name = str_repeat($name, 2);
$obj->$name = 1;
var_dump($name);
?>
--EXPECT--
string(6) "foofoo"
int(24)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #75420.8 (Indirect modification of magic method argument)
--FILE--
<?php
class Test {
public function __set($x,$v) { $GLOBALS["obj"] = 24; var_dump($this); }
}
$obj = new Test;
$name = "foo";
$obj->$name = 1;
var_dump($obj);
?>
--EXPECT--
object(Test)#1 (0) {
}
int(24)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75420.9 (Indirect modification of magic method argument)
--FILE--
<?php
class Test implements ArrayAccess {
public function offsetExists($x) { $GLOBALS["name"] = 24; return true; }
public function offsetGet($x) { var_dump($x); return 42; }
public function offsetSet($x, $y) { }
public function offsetUnset($x) { }
}
$obj = new Test;
$name = "foo";
var_dump($obj[$name] ?? 12);
var_dump($name);
?>
--EXPECT--
string(3) "foo"
int(42)
int(24)
+17
View File
@@ -0,0 +1,17 @@
--TEST--
Bug #75420 (Crash when modifing property name in __isset for BP_VAR_IS)
--FILE--
<?php
class Test {
public function __isset($x) { $GLOBALS["name"] = 24; return true; }
public function __get($x) { var_dump($x); return 42; }
}
$obj = new Test;
$name = "foo";
var_dump($obj->$name ?? 12);
?>
--EXPECT--
string(3) "foo"
int(42)
+64
View File
@@ -0,0 +1,64 @@
--TEST--
Bug #75573 (Segmentation fault in 7.1.12 and 7.0.26)
--FILE--
<?php
class A
{
var $_stdObject;
function initialize($properties = FALSE) {
$this->_stdObject = $properties ? (object) $properties : new stdClass();
parent::initialize();
}
function &__get($property)
{
if (isset($this->_stdObject->{$property})) {
$retval =& $this->_stdObject->{$property};
return $retval;
} else {
return NULL;
}
}
function &__set($property, $value)
{
return $this->_stdObject->{$property} = $value;
}
function __isset($property_name)
{
return isset($this->_stdObject->{$property_name});
}
}
class B extends A
{
function initialize($properties = array())
{
parent::initialize($properties);
}
function &__get($property)
{
if (isset($this->settings) && isset($this->settings[$property])) {
$retval =& $this->settings[$property];
return $retval;
} else {
return parent::__get($property);
}
}
}
$b = new B();
$b->settings = [ "foo" => "bar", "name" => "abc" ];
var_dump($b->name);
var_dump($b->settings);
?>
--EXPECTF--
Warning: Creating default object from empty value in %sbug75573.php on line %d
Notice: Only variable references should be returned by reference in %sbug75573.php on line %d
string(3) "abc"
array(2) {
["foo"]=>
string(3) "bar"
["name"]=>
string(3) "abc"
}
+45
View File
@@ -0,0 +1,45 @@
--TEST--
Bug #74954 (crash after update of generator yielding from finished generator)
--FILE--
<?php
function from() {
yield 1;
throw new Exception();
}
function gen($gen) {
try {
var_dump(yield from $gen);
} catch (Exception $e) { print "Caught exception!\n$e\n"; }
}
$gen = from();
$gens[] = gen($gen);
$gens[] = gen($gen);
foreach ($gens as $g) {
$g->current();
}
do {
foreach ($gens as $i => $g) {
$g->next();
}
} while($gens[0]->valid());
?>
--EXPECTF--
Caught exception!
Exception in %s:%d
Stack trace:
#0 %s(%d): from()
#1 [internal function]: gen(Object(Generator))
#2 %s(%d): Generator->next()
#3 {main}
Caught exception!
ClosedGeneratorException: Generator yielded from aborted, no return value available in %s:%d
Stack trace:
#0 [internal function]: gen(Object(Generator))
#1 %s(%d): Generator->next()
#2 {main}
+3 -1
View File
@@ -701,7 +701,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions) /
zend_compile_file = compile_file;
zend_execute_ex = execute_ex;
zend_execute_internal = NULL;
#endif /* HAVE_SYS_SDT_H */
#endif /* HAVE_DTRACE */
zend_compile_string = compile_string;
zend_throw_exception_hook = NULL;
@@ -896,6 +896,8 @@ void zend_set_utility_values(zend_utility_values *utility_values) /* {{{ */
/* this should be compatible with the standard zenderror */
ZEND_COLD void zenderror(const char *error) /* {{{ */
{
CG(parse_error) = 0;
if (EG(exception)) {
/* An exception was thrown in the lexer, don't throw another in the parser. */
return;
-1
View File
@@ -297,7 +297,6 @@ ZEND_COLD void zenderror(const char *error);
#define ZEND_STANDARD_CLASS_DEF_PTR zend_standard_class_def
extern ZEND_API zend_class_entry *zend_standard_class_def;
extern ZEND_API zend_utility_values zend_uv;
extern ZEND_API zval zval_used_for_init;
/* If DTrace is available and enabled */
extern ZEND_API zend_bool zend_dtrace_enabled;
+6 -3
View File
@@ -3067,7 +3067,8 @@ get_function_via_handler:
(!fcc->function_handler->common.scope ||
!instanceof_function(ce_org, fcc->function_handler->common.scope))) {
if (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
@@ -3237,7 +3238,8 @@ again:
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
@@ -3324,7 +3326,8 @@ again:
((fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY ||
fcc->function_handler->type == ZEND_OVERLOADED_FUNCTION)) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION) {
if (fcc->function_handler->type != ZEND_OVERLOADED_FUNCTION &&
fcc->function_handler->common.function_name) {
zend_string_release(fcc->function_handler->common.function_name);
}
zend_free_trampoline(fcc->function_handler);
+1 -1
View File
@@ -709,7 +709,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int severity, in
int _num_args = EX_NUM_ARGS(); \
int _i; \
zval *_real_arg, *_arg = NULL; \
zend_expected_type _expected_type = IS_UNDEF; \
zend_expected_type _expected_type = Z_EXPECTED_LONG; \
char *_error = NULL; \
zend_bool _dummy; \
zend_bool _optional = 0; \
+19 -1
View File
@@ -267,6 +267,8 @@ struct _zend_mm_heap {
int peak_chunks_count; /* peak number of allocated chunks for current request */
int cached_chunks_count; /* number of cached chunks */
double avg_chunks_count; /* average number of chunks allocated per request */
int last_chunks_delete_boundary; /* numer of chunks after last deletion */
int last_chunks_delete_count; /* number of deletion over the last boundary */
#if ZEND_MM_CUSTOM
union {
struct {
@@ -1122,7 +1124,9 @@ static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_
chunk->next->prev = chunk->prev;
chunk->prev->next = chunk->next;
heap->chunks_count--;
if (heap->chunks_count + heap->cached_chunks_count < heap->avg_chunks_count + 0.1) {
if (heap->chunks_count + heap->cached_chunks_count < heap->avg_chunks_count + 0.1
|| (heap->chunks_count == heap->last_chunks_delete_boundary
&& heap->last_chunks_delete_count >= 4)) {
/* delay deletion */
heap->cached_chunks_count++;
chunk->next = heap->cached_chunks;
@@ -1131,6 +1135,14 @@ static zend_always_inline void zend_mm_delete_chunk(zend_mm_heap *heap, zend_mm_
#if ZEND_MM_STAT || ZEND_MM_LIMIT
heap->real_size -= ZEND_MM_CHUNK_SIZE;
#endif
if (!heap->cached_chunks) {
if (heap->chunks_count != heap->last_chunks_delete_boundary) {
heap->last_chunks_delete_boundary = heap->chunks_count;
heap->last_chunks_delete_count = 0;
} else {
heap->last_chunks_delete_count++;
}
}
if (!heap->cached_chunks || chunk->num > heap->cached_chunks->num) {
zend_mm_chunk_free(heap, chunk, ZEND_MM_CHUNK_SIZE);
} else {
@@ -1864,6 +1876,8 @@ static zend_mm_heap *zend_mm_init(void)
heap->peak_chunks_count = 1;
heap->cached_chunks_count = 0;
heap->avg_chunks_count = 1.0;
heap->last_chunks_delete_boundary = 0;
heap->last_chunks_delete_count = 0;
#if ZEND_MM_STAT || ZEND_MM_LIMIT
heap->real_size = ZEND_MM_CHUNK_SIZE;
#endif
@@ -2279,6 +2293,8 @@ void zend_mm_shutdown(zend_mm_heap *heap, int full, int silent)
p->map[0] = ZEND_MM_LRUN(ZEND_MM_FIRST_PAGE);
heap->chunks_count = 1;
heap->peak_chunks_count = 1;
heap->last_chunks_delete_boundary = 0;
heap->last_chunks_delete_count = 0;
#if ZEND_MM_STAT || ZEND_MM_LIMIT
heap->real_size = ZEND_MM_CHUNK_SIZE;
#endif
@@ -2811,6 +2827,8 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_handlers *handlers, void
heap->peak_chunks_count = 1;
heap->cached_chunks_count = 0;
heap->avg_chunks_count = 1.0;
heap->last_chunks_delete_boundary = 0;
heap->last_chunks_delete_count = 0;
#if ZEND_MM_STAT || ZEND_MM_LIMIT
heap->real_size = ZEND_MM_CHUNK_SIZE;
#endif
+1 -1
View File
@@ -1203,7 +1203,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_symbtable_add_new(Z_ARRVAL_P(return_value), key, value);
zend_symtable_add_new(Z_ARRVAL_P(return_value), key, value);
}
}
}
+10 -3
View File
@@ -414,6 +414,7 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
zval val;
struct _zend_arg_info *arg_info = closure->func.common.arg_info;
HashTable *debug_info;
zend_bool zstr_args = (closure->func.type == ZEND_USER_FUNCTION) || (closure->func.common.fn_flags & ZEND_ACC_USER_ARG_INFO);
*is_temp = 1;
@@ -446,9 +447,15 @@ static HashTable *zend_closure_get_debug_info(zval *object, int *is_temp) /* {{{
zend_string *name;
zval info;
if (arg_info->name) {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
ZSTR_VAL(arg_info->name));
if (zstr_args) {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
ZSTR_VAL(arg_info->name));
} else {
name = zend_strpprintf(0, "%s$%s",
arg_info->pass_by_reference ? "&" : "",
((zend_internal_arg_info*)arg_info)->name);
}
} else {
name = zend_strpprintf(0, "%s$param%d",
arg_info->pass_by_reference ? "&" : "",
+1 -1
View File
@@ -5601,7 +5601,7 @@ void zend_compile_use(zend_ast *ast) /* {{{ */
zend_string *ns_name = zend_string_alloc(ZSTR_LEN(current_ns) + 1 + ZSTR_LEN(new_name), 0);
zend_str_tolower_copy(ZSTR_VAL(ns_name), ZSTR_VAL(current_ns), ZSTR_LEN(current_ns));
ZSTR_VAL(ns_name)[ZSTR_LEN(current_ns)] = '\\';
memcpy(ZSTR_VAL(ns_name) + ZSTR_LEN(current_ns) + 1, ZSTR_VAL(lookup_name), ZSTR_LEN(lookup_name));
memcpy(ZSTR_VAL(ns_name) + ZSTR_LEN(current_ns) + 1, ZSTR_VAL(lookup_name), ZSTR_LEN(lookup_name) + 1);
zend_check_use_conflict(type, old_name, new_name, ns_name);
+2 -4
View File
@@ -644,15 +644,13 @@ failure:
ZEND_API void zend_generator_resume(zend_generator *orig_generator) /* {{{ */
{
zend_generator *generator;
zend_generator *generator = zend_generator_get_current(orig_generator);
/* The generator is already closed, thus can't resume */
if (UNEXPECTED(!orig_generator->execute_data)) {
if (UNEXPECTED(!generator->execute_data)) {
return;
}
generator = zend_generator_get_current(orig_generator);
try_again:
if (generator->flags & ZEND_GENERATOR_CURRENTLY_RUNNING) {
zend_throw_error(NULL, "Cannot resume an already running generator");
+5 -1
View File
@@ -310,7 +310,7 @@ 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)
static zend_always_inline zval *zend_symtable_add_new(HashTable *ht, zend_string *key, zval *pData)
{
zend_ulong idx;
@@ -321,6 +321,10 @@ static zend_always_inline zval *zend_symbtable_add_new(HashTable *ht, zend_strin
}
}
/* This typo snuck into 7.0.17 and 7.1.3, this define exists for BC */
#define zend_symbtable_add_new(ht, key, pData) \
zend_symtable_add_new(ht, key, pData)
static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData)
{
zend_ulong idx;
File diff suppressed because it is too large. Load diff
-2
View File
@@ -1676,7 +1676,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
if (errno == ERANGE) { /* Overflow */
errno = 0;
if (yytext[0] == '0') { /* octal overflow */
errno = 0;
ZVAL_DOUBLE(zendlval, zend_oct_strtod(yytext, (const char **)&end));
} else {
ZVAL_DOUBLE(zendlval, zend_strtod(yytext, (const char **)&end));
@@ -1688,7 +1687,6 @@ NEWLINE ("\r"|"\n"|"\r\n")
ZVAL_UNDEF(zendlval);
RETURN_TOKEN(T_DNUMBER);
}
ZEND_ASSERT(!errno);
RETURN_TOKEN(T_DNUMBER);
}
/* Also not an assert for the same reason */
+2 -2
View File
@@ -53,8 +53,8 @@
__asm__("mul %0, %2, %3\n" \
"smulh %1, %2, %3\n" \
"sub %1, %1, %0, asr #63\n" \
: "=X"(__tmpvar), "=X"(usedval) \
: "X"(a), "X"(b)); \
: "=&r"(__tmpvar), "=&r"(usedval) \
: "r"(a), "r"(b)); \
if (usedval) (dval) = (double) (a) * (double) (b); \
else (lval) = __tmpvar; \
} while (0)
+60 -31
View File
@@ -507,9 +507,10 @@ static zend_long *zend_get_property_guard(zend_object *zobj, zend_string *member
zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{
zend_object *zobj;
zval tmp_member;
zval tmp_member, tmp_object;
zval *retval;
uint32_t property_offset;
zend_long *guard = NULL;
zobj = Z_OBJ_P(object);
@@ -542,12 +543,18 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
goto exit;
}
ZVAL_UNDEF(&tmp_object);
/* magic isset */
if ((type == BP_VAR_IS) && zobj->ce->__isset) {
zval tmp_object, tmp_result;
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
zval tmp_result;
guard = zend_get_property_guard(zobj, Z_STR_P(member));
if (!((*guard) & IN_ISSET)) {
if (Z_TYPE(tmp_member) == IS_UNDEF) {
ZVAL_COPY(&tmp_member, member);
member = &tmp_member;
}
ZVAL_COPY(&tmp_object, object);
ZVAL_UNDEF(&tmp_result);
@@ -562,19 +569,20 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
goto exit;
}
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_result);
}
}
/* magic get */
if (zobj->ce->__get) {
zend_long *guard = zend_get_property_guard(zobj, Z_STR_P(member));
if (guard == NULL) {
guard = zend_get_property_guard(zobj, Z_STR_P(member));
}
if (!((*guard) & IN_GET)) {
zval tmp_object;
/* have getter - try with it! */
ZVAL_COPY(&tmp_object, object);
if (Z_TYPE(tmp_object) == IS_UNDEF) {
ZVAL_COPY(&tmp_object, object);
}
*guard |= IN_GET; /* prevent circular getting */
zend_std_call_getter(&tmp_object, member, rv);
*guard &= ~IN_GET;
@@ -595,6 +603,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
goto exit;
} else {
if (Z_STRVAL_P(member)[0] == '\0') {
zval_ptr_dtor(&tmp_object);
if (Z_STRLEN_P(member) == 0) {
zend_throw_error(NULL, "Cannot access empty property");
retval = &EG(uninitialized_zval);
@@ -607,6 +616,9 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
}
}
}
zval_ptr_dtor(&tmp_object);
if ((type != BP_VAR_IS)) {
zend_error(E_NOTICE,"Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), Z_STRVAL_P(member));
}
@@ -722,34 +734,38 @@ exit:
zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval tmp;
zval tmp_offset, tmp_object;
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
if (offset == NULL) {
/* [] construct */
ZVAL_NULL(&tmp);
offset = &tmp;
ZVAL_NULL(&tmp_offset);
} else {
SEPARATE_ARG_IF_REF(offset);
ZVAL_DEREF(offset);
ZVAL_COPY(&tmp_offset, offset);
}
ZVAL_COPY(&tmp_object, object);
if (type == BP_VAR_IS) {
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", rv, offset);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", rv, &tmp_offset);
if (UNEXPECTED(Z_ISUNDEF_P(rv))) {
zval_ptr_dtor(offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
return NULL;
}
if (!i_zend_is_true(rv)) {
zval_ptr_dtor(offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
zval_ptr_dtor(rv);
return &EG(uninitialized_zval);
}
zval_ptr_dtor(rv);
}
zend_call_method_with_1_params(object, ce, NULL, "offsetget", rv, offset);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", rv, &tmp_offset);
zval_ptr_dtor(offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
if (UNEXPECTED(Z_TYPE_P(rv) == IS_UNDEF)) {
if (UNEXPECTED(!EG(exception))) {
@@ -768,17 +784,19 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /*
static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval tmp;
zval tmp_offset, tmp_object;
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
if (!offset) {
ZVAL_NULL(&tmp);
offset = &tmp;
ZVAL_NULL(&tmp_offset);
} else {
SEPARATE_ARG_IF_REF(offset);
ZVAL_DEREF(offset);
ZVAL_COPY(&tmp_offset, offset);
}
zend_call_method_with_2_params(object, ce, NULL, "offsetset", NULL, offset, value);
zval_ptr_dtor(offset);
ZVAL_COPY(&tmp_object, object);
zend_call_method_with_2_params(&tmp_object, ce, NULL, "offsetset", NULL, &tmp_offset, value);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
} else {
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
}
@@ -788,17 +806,19 @@ static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /*
static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval retval;
zval retval, tmp_offset, tmp_object;
int result;
if (EXPECTED(instanceof_function_ex(ce, zend_ce_arrayaccess, 1) != 0)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(object, ce, NULL, "offsetexists", &retval, offset);
ZVAL_DEREF(offset);
ZVAL_COPY(&tmp_offset, offset);
ZVAL_COPY(&tmp_object, object);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetexists", &retval, &tmp_offset);
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
result = i_zend_is_true(&retval);
zval_ptr_dtor(&retval);
if (check_empty && result && EXPECTED(!EG(exception))) {
zend_call_method_with_1_params(object, ce, NULL, "offsetget", &retval, offset);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetget", &retval, &tmp_offset);
if (EXPECTED(Z_TYPE(retval) != IS_UNDEF)) {
result = i_zend_is_true(&retval);
zval_ptr_dtor(&retval);
@@ -807,7 +827,8 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) /
} else {
result = 0;
}
zval_ptr_dtor(offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
} else {
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
return 0;
@@ -969,11 +990,15 @@ exit:
static void zend_std_unset_dimension(zval *object, zval *offset) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval tmp_offset, tmp_object;
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(object, ce, NULL, "offsetunset", NULL, offset);
zval_ptr_dtor(offset);
ZVAL_DEREF(offset);
ZVAL_COPY(&tmp_offset, offset);
ZVAL_COPY(&tmp_object, object);
zend_call_method_with_1_params(&tmp_object, ce, NULL, "offsetunset", NULL, &tmp_offset);
zval_ptr_dtor(&tmp_object);
zval_ptr_dtor(&tmp_offset);
} else {
zend_throw_error(NULL, "Cannot use object of type %s as array", ZSTR_VAL(ce->name));
}
@@ -1507,6 +1532,10 @@ found:
zval tmp_object;
/* have issetter - try with it! */
if (Z_TYPE(tmp_member) == IS_UNDEF) {
ZVAL_COPY(&tmp_member, member);
member = &tmp_member;
}
ZVAL_COPY(&tmp_object, object);
(*guard) |= IN_ISSET; /* prevent circular getting */
zend_std_call_issetter(&tmp_object, member, &rv);
+3 -1
View File
@@ -221,8 +221,10 @@ try_again:
if (Z_TYPE(holder) == IS_LONG) { \
if (op == result) { \
zval_ptr_dtor(op); \
ZVAL_LONG(op, Z_LVAL(holder)); \
} else { \
(op) = &(holder); \
} \
(op) = &(holder); \
} \
break; \
} \
+1 -1
View File
@@ -433,7 +433,7 @@ char *alloca();
#define ZEND_STRL(str) (str), (sizeof(str)-1)
#define ZEND_STRS(str) (str), (sizeof(str))
#define ZEND_NORMALIZE_BOOL(n) \
((n) ? (((n)>0) ? 1 : -1) : 0)
((n) ? (((n)<0) ? -1 : 1) : 0)
#define ZEND_TRUTH(x) ((x) ? 1 : 0)
#define ZEND_LOG_XOR(a, b) (ZEND_TRUTH(a) ^ ZEND_TRUTH(b))
+4
View File
@@ -72,6 +72,10 @@ typedef unsigned long int uint32_t;
#define NO_INFNAN_CHECK
#endif
#ifndef NO_ERRNO
#define NO_ERRNO
#endif
#ifdef WORDS_BIGENDIAN
#define IEEE_BIG_ENDIAN 1
#else
+4 -2
View File
@@ -219,8 +219,10 @@ ZEND_API void ZEND_FASTCALL _zval_copy_ctor_func(zval *zvalue ZEND_FILE_LINE_DC)
{
if (EXPECTED(Z_TYPE_P(zvalue) == IS_ARRAY)) {
ZVAL_ARR(zvalue, zend_array_dup(Z_ARRVAL_P(zvalue)));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING) ||
EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_STRING)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
ZVAL_NEW_STR(zvalue, zend_string_dup(Z_STR_P(zvalue), 0));
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT)) {
CHECK_ZVAL_STRING_REL(Z_STR_P(zvalue));
Z_STR_P(zvalue) = zend_string_dup(Z_STR_P(zvalue), 0);
} else if (EXPECTED(Z_TYPE_P(zvalue) == IS_CONSTANT_AST)) {
+19 -2
View File
@@ -45,6 +45,19 @@
# define IO_REPARSE_TAG_DEDUP 0x80000013
# endif
# ifndef IO_REPARSE_TAG_CLOUD
# define IO_REPARSE_TAG_CLOUD (0x9000001AL)
# endif
/* IO_REPARSE_TAG_CLOUD_1 through IO_REPARSE_TAG_CLOUD_F have values of 0x9000101AL
to 0x9000F01AL, they can be checked against the mask. */
#ifndef IO_REPARSE_TAG_CLOUD_MASK
#define IO_REPARSE_TAG_CLOUD_MASK (0x0000F000L)
#endif
#ifndef IO_REPARSE_TAG_ONEDRIVE
#define IO_REPARSE_TAG_ONEDRIVE (0x80000021L)
#endif
# ifndef VOLUME_NAME_NT
# define VOLUME_NAME_NT 0x2
# endif
@@ -908,7 +921,7 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
return -1;
}
hLink = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
hLink = CreateFile(path, 0, 0, NULL, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, NULL);
if(hLink == INVALID_HANDLE_VALUE) {
return -1;
}
@@ -977,7 +990,11 @@ static int tsrm_realpath_r(char *path, int start, int len, int *ll, time_t *t, i
};
substitutename[substitutename_len] = 0;
}
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP) {
else if (pbuffer->ReparseTag == IO_REPARSE_TAG_DEDUP ||
/* Starting with 1709. */
(pbuffer->ReparseTag & IO_REPARSE_TAG_CLOUD_MASK) != 0 && 0x90001018L != pbuffer->ReparseTag ||
IO_REPARSE_TAG_CLOUD == pbuffer->ReparseTag ||
IO_REPARSE_TAG_ONEDRIVE == pbuffer->ReparseTag) {
isabsolute = 1;
memcpy(substitutename, path, len + 1);
substitutename_len = len;
+15 -15
View File
@@ -2692,21 +2692,21 @@ EOF
else
CONFIGURE_COMMAND="$CONFIGURE_COMMAND [$]0"
fi
for arg in $clean_configure_args; do
if test `expr -- $arg : "'.*"` = 0; then
if test `expr -- $arg : "-.*"` = 0 && test `expr -- $arg : ".*=.*"` = 0; then
continue;
fi
echo "'[$]arg' \\" >> $1
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS '[$]arg'"
else
if test `expr -- $arg : "'-.*"` = 0 && test `expr -- $arg : "'.*=.*"` = 0; then
continue;
fi
echo "[$]arg \\" >> $1
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS [$]arg"
fi
CONFIGURE_ARGS="$clean_configure_args"
while test "X$CONFIGURE_ARGS" != "X";
do
if CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\('[[^']]*'\)"`
then
CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *'[[^']]*' \(.*\)"`
elif CURRENT_ARG=`expr "X$CONFIGURE_ARGS" : "X *\([[^ ]]*\)"`
then
CONFIGURE_ARGS=`expr "X$CONFIGURE_ARGS" : "X *[[^ ]]* \(.*\)"`
CURRENT_ARG="'$CURRENT_ARG'"
else
break
fi
$as_echo "$CURRENT_ARG \\" >>$1
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $CURRENT_ARG"
done
echo '"[$]@"' >> $1
chmod +x $1
+11 -2
View File
@@ -2,6 +2,7 @@
set SDK_REMOTE=https://github.com/OSTC/php-sdk-binary-tools.git
set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH%
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-vc14-%PLATFORM%.bat
if not exist "%PHP_BUILD_CACHE_BASE_DIR%" (
echo Creating %PHP_BUILD_CACHE_BASE_DIR%
@@ -13,17 +14,25 @@ if not exist "%PHP_BUILD_OBJ_DIR%" (
mkdir "%PHP_BUILD_OBJ_DIR%"
)
if not exist "%SDK_RUNNER%" (
if exist "%PHP_BUILD_CACHE_SDK_DIR%" rmdir /s /q "%PHP_BUILD_CACHE_SDK_DIR%"
)
if not exist "%PHP_BUILD_CACHE_SDK_DIR%" (
echo Cloning remote SDK repository
git clone --branch %SDK_BRANCH% %SDK_REMOTE% "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
) else (
)
for /f "tokens=*" %%a in ('type %PHP_BUILD_CACHE_SDK_DIR%\VERSION') do set GOT_SDK_VER=%%a
echo Got SDK version %GOT_SDK_VER%
if NOT "%GOT_SDK_VER%" == "%PHP_BUILD_SDK_BRANCH:~8%" (
echo Switching to the configured SDK version %SDK_BRANCH:~8%
echo Fetching remote SDK repository
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1
echo Checkout SDK repository branch
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
)
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-vc14-%PLATFORM%.bat
if not exist "%SDK_RUNNER%" (
echo "%SDK_RUNNER%" doesn't exist
exit /b 3
+5 -1
View File
@@ -2,10 +2,14 @@
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
if %errorlevel% neq 0 exit /b 3
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
if %errorlevel% neq 0 exit /b 3
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
if %errorlevel% neq 0 exit /b 3
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
if %errorlevel% neq 0 exit /b 3
if "%APPVEYOR%" equ "True" rmdir /s /q C:\msys64 >NUL 2>NUL
if %errorlevel% neq 0 exit /b 3
cd /D %APPVEYOR_BUILD_FOLDER%
if %errorlevel% neq 0 exit /b 3
@@ -34,7 +38,7 @@ if %errorlevel% neq 0 exit /b 3
if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts
set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,dba
set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,dba,ftp
if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
cmd /c configure.bat ^
+1 -1
View File
@@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=0
PHP_RELEASE_VERSION=22
PHP_RELEASE_VERSION=29
PHP_EXTRA_VERSION=""
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+1 -1
View File
@@ -59,7 +59,7 @@ bc_divmod (bc_num num1, bc_num num2, bc_num *quot, bc_num *rem, int scale)
bc_init_num(&temp);
/* Calculate it. */
bc_divide (num1, num2, &temp, scale);
bc_divide (num1, num2, &temp, 0);
if (quot)
quotient = bc_copy_num (temp);
bc_multiply (temp, num2, &temp, rscale);
+27 -12
View File
@@ -45,7 +45,7 @@
int
bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
{
bc_num power, exponent, parity, temp;
bc_num power, exponent, modulus, parity, temp;
int rscale;
/* Check for correct numbers. */
@@ -55,12 +55,16 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
/* Set initial values. */
power = bc_copy_num (base);
exponent = bc_copy_num (expo);
modulus = bc_copy_num (mod);
temp = bc_copy_num (BCG(_one_));
bc_init_num(&parity);
/* Check the base for scale digits. */
if (base->n_scale != 0)
if (power->n_scale != 0)
{
bc_rt_warn ("non-zero scale in base");
bc_divide (power, BCG(_one_), &power, 0); /*truncate */
}
/* Check the exponent for scale digits. */
if (exponent->n_scale != 0)
@@ -70,27 +74,38 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
}
/* Check the modulus for scale digits. */
if (mod->n_scale != 0)
if (modulus->n_scale != 0)
{
bc_rt_warn ("non-zero scale in modulus");
bc_divide (modulus, BCG(_one_), &modulus, 0); /*truncate */
}
/* Do the calculation. */
rscale = MAX(scale, base->n_scale);
while ( !bc_is_zero(exponent) )
rscale = MAX(scale, power->n_scale);
if ( !bc_compare(modulus, BCG(_one_)) )
{
(void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0);
if ( !bc_is_zero(parity) )
temp = bc_new_num (1, scale);
}
else
{
while ( !bc_is_zero(exponent) )
{
bc_multiply (temp, power, &temp, rscale);
(void) bc_modulo (temp, mod, &temp, scale);
}
(void) bc_divmod (exponent, BCG(_two_), &exponent, &parity, 0);
if ( !bc_is_zero(parity) )
{
bc_multiply (temp, power, &temp, rscale);
(void) bc_modulo (temp, modulus, &temp, scale);
}
bc_multiply (power, power, &power, rscale);
(void) bc_modulo (power, mod, &power, scale);
bc_multiply (power, power, &power, rscale);
(void) bc_modulo (power, modulus, &power, scale);
}
}
/* Assign the value. */
bc_free_num (&power);
bc_free_num (&exponent);
bc_free_num (&modulus);
bc_free_num (result);
bc_free_num (&parity);
*result = temp;
+3
View File
@@ -105,5 +105,8 @@ bc_str2num (bc_num *num, char *str, int scale)
for (;strscale > 0; strscale--)
*nptr++ = CH_VAL(*ptr++);
}
if (bc_is_zero (*num))
(*num)->n_sign = PLUS;
}
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #44995 (bcpowmod() fails if scale != 0)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension not available');
?>
--FILE--
<?php
var_dump(bcpowmod('4', '4', '3', 1));
var_dump(bcpowmod('3234', '32345', '22345', 1));
?>
===DONE===
--EXPECT--
string(3) "1.0"
string(7) "17334.0"
===DONE===
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #46781 (BC math handles minus zero incorrectly)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
?>
--FILE--
<?php
var_dump(bcadd('-0.0', '-0.0', 1));
var_dump(bccomp('-0.0', '0', 1));
?>
===DONE===
--EXPECT--
string(3) "0.0"
int(0)
===DONE===
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #54598 (bcpowmod() may return 1 if modulus is 1)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
?>
--FILE--
<?php
var_dump(bcpowmod(5, 0, 1));
var_dump(bcpowmod(5, 0, 1, 3));
?>
===DONE===
--EXPECT--
string(1) "0"
string(5) "0.000"
===DONE===
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
if (substr(PHP_OS, 0, 3) != 'WIN') {
die('skip valid only for windows');
}
?>
--FILE--
<?php
var_dump(bcpowmod('4.1', '4', '3', 3));
var_dump(bcpowmod('4', '4', '3.1', 3));
?>
===DONE===
--EXPECT--
string(5) "1.000"
string(5) "1.000"
===DONE===
bc math warning: non-zero scale in base
bc math warning: non-zero scale in modulus
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #75178 (bcpowmod() misbehaves for non-integer base or modulus)
--SKIPIF--
<?php
if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip Not valid for windows');
}
?>
--FILE--
<?php
var_dump(bcpowmod('4.1', '4', '3', 3));
var_dump(bcpowmod('4', '4', '3.1', 3));
?>
===DONE===
--EXPECT--
bc math warning: non-zero scale in base
string(5) "1.000"
bc math warning: non-zero scale in modulus
string(5) "1.000"
===DONE===
+23 -4
View File
@@ -17,12 +17,24 @@ if test "$PHP_CURL" != "no"; then
break
fi
done
if test -z "$CURL_DIR"; then
AC_MSG_RESULT(not found)
if which dpkg-architecture>/dev/null; then
AC_MSG_CHECKING(for cURL in multiarch path)
CURL_MULTIARCH_INCLUDE=/usr/include/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
if test -r $CURL_MULTIARCH_INCLUDE/curl/easy.h; then
CURL_DIR=/usr
AC_MSG_RESULT(found in $CURL_MULTIARCH_INCLUDE)
else
AC_MSG_RESULT(not found)
fi
fi
fi
fi
if test -z "$CURL_DIR"; then
AC_MSG_RESULT(not found)
AC_MSG_ERROR(Please reinstall the libcurl distribution -
easy.h should be in <curl-dir>/include/curl/)
AC_MSG_ERROR(Could not find cURL, please reinstall the libcurl distribution -dnl
easy.h should be in <curl-dir>/include/curl/)
fi
CURL_CONFIG="curl-config"
@@ -45,7 +57,11 @@ if test "$PHP_CURL" != "no"; then
AC_MSG_ERROR(cURL version 7.10.5 or later is required to compile php with cURL support)
fi
PHP_ADD_INCLUDE($CURL_DIR/include)
if test -z "$CURL_MULTIARCH_INCLUDE"; then
PHP_ADD_INCLUDE($CURL_DIR/include)
else
PHP_ADD_INCLUDE($CURL_MULTIARCH_INCLUDE)
fi
PHP_EVAL_LIBLINE($CURL_LIBS, CURL_SHARED_LIBADD)
PHP_ADD_LIBRARY_WITH_PATH(curl, $CURL_DIR/$PHP_LIBDIR, CURL_SHARED_LIBADD)
@@ -57,6 +73,8 @@ if test "$PHP_CURL" != "no"; then
save_CFLAGS="$CFLAGS"
CFLAGS="`$CURL_CONFIG --cflags`"
save_LDFLAGS="$LDFLAGS"
LDFLAGS="`$CURL_CONFIG --libs`"
AC_PROG_CPP
AC_MSG_CHECKING([for openssl support in libcurl])
@@ -114,6 +132,7 @@ int main(int argc, char *argv[])
])
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
else
AC_MSG_RESULT([no])
fi
+2424 -837
View File
File diff suppressed because it is too large. Load diff
+2 -2
View File
@@ -917,8 +917,8 @@ isoweek = year4 "-"? "W" weekofyear;
exif = year4 ":" monthlz ":" daylz " " hour24lz ":" minutelz ":" secondlz;
firstdayof = 'first day of';
lastdayof = 'last day of';
backof = 'back of ' hour24 space? meridian?;
frontof = 'front of ' hour24 space? meridian?;
backof = 'back of ' hour24 (space? meridian)?;
frontof = 'front of ' hour24 (space? meridian)?;
/* Common Log Format: 10/Oct/2000:13:55:36 -0700 */
clf = day "/" monthabbr "/" year4 ":" hour24lz ":" minutelz ":" secondlz space tzcorrection;
+1009 -1078
View File
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+41 -1
View File
@@ -647,6 +647,7 @@ static HashTable *date_object_get_gc_timezone(zval *object, zval **table, int *n
zval *date_interval_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
void date_interval_write_property(zval *object, zval *member, zval *value, void **cache_slot);
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot);
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv);
static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot);
@@ -910,6 +911,7 @@ PHP_MINFO_FUNCTION(date)
php_info_print_table_start();
php_info_print_table_row(2, "date/time support", "enabled");
php_info_print_table_row(2, "timelib version", TIMELIB_ASCII_VERSION);
php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal");
php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb));
@@ -1932,6 +1934,10 @@ static void date_period_it_rewind(zend_object_iterator *iter)
if (iterator->object->current) {
timelib_time_dtor(iterator->object->current);
}
if (!iterator->object->start) {
zend_throw_error(NULL, "DatePeriod has not been initialized correctly");
return;
}
iterator->object->current = timelib_time_clone(iterator->object->start);
date_period_it_invalidate_current(iter);
}
@@ -2112,7 +2118,7 @@ static void date_register_classes(void) /* {{{ */
date_object_handlers_interval.read_property = date_interval_read_property;
date_object_handlers_interval.write_property = date_interval_write_property;
date_object_handlers_interval.get_properties = date_object_get_properties_interval;
date_object_handlers_interval.get_property_ptr_ptr = NULL;
date_object_handlers_interval.get_property_ptr_ptr = date_interval_get_property_ptr_ptr;
date_object_handlers_interval.get_gc = date_object_get_gc_interval;
INIT_CLASS_ENTRY(ce_period, "DatePeriod", date_funcs_period);
@@ -4137,6 +4143,40 @@ void date_interval_write_property(zval *object, zval *member, zval *value, void
}
/* }}} */
/* {{{ date_interval_get_property_ptr_ptr */
static zval *date_interval_get_property_ptr_ptr(zval *object, zval *member, int type, void **cache_slot)
{
zval tmp_member, *ret;
if (Z_TYPE_P(member) != IS_STRING) {
tmp_member = *member;
zval_copy_ctor(&tmp_member);
convert_to_string(&tmp_member);
member = &tmp_member;
cache_slot = NULL;
}
if(zend_binary_strcmp("y", sizeof("y") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("m", sizeof("m") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("d", sizeof("d") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("h", sizeof("h") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("i", sizeof("i") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("s", sizeof("s") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("days", sizeof("days") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0 ||
zend_binary_strcmp("invert", sizeof("invert") - 1, Z_STRVAL_P(member), Z_STRLEN_P(member)) == 0) {
/* Fallback to read_property. */
ret = NULL;
} else {
ret = (zend_get_std_object_handlers())->get_property_ptr_ptr(object, member, type, cache_slot);
}
if (member == &tmp_member) {
zval_dtor(member);
}
return ret;
}
/* }}} */
/* {{{ proto DateInterval::__construct([string interval_spec])
Creates new DateInterval object.
+12 -21
View File
@@ -8,17 +8,8 @@ date_default_timezone_set('UTC');
echo "Done\n";
?>
--EXPECTF--
array(6) {
array(5) {
[0]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(0)
["timezone_id"]=>
string(16) "Antarctica/Troll"
}
[1]=>
array(3) {
["dst"]=>
bool(false)
@@ -27,7 +18,7 @@ array(6) {
["timezone_id"]=>
string(13) "Etc/Universal"
}
[2]=>
[1]=>
array(3) {
["dst"]=>
bool(false)
@@ -36,7 +27,7 @@ array(6) {
["timezone_id"]=>
string(7) "Etc/UTC"
}
[3]=>
[2]=>
array(3) {
["dst"]=>
bool(false)
@@ -45,6 +36,15 @@ array(6) {
["timezone_id"]=>
string(8) "Etc/Zulu"
}
[3]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(0)
["timezone_id"]=>
string(3) "UTC"
}
[4]=>
array(3) {
["dst"]=>
@@ -54,14 +54,5 @@ array(6) {
["timezone_id"]=>
string(3) "UTC"
}
[5]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(0)
["timezone_id"]=>
string(3) "UTC"
}
}
Done
+1 -23
View File
@@ -1,6 +1,5 @@
--TEST--
DateTimeZone::getLocation -- timezone_location_get — Returns location information for a timezone
public array DateTimeZone::getLocation ( void ) ;
DateTimeZone::getLocation -- timezone_location_get — Returns location information for a timezone public array DateTimeZone::getLocation ( void ) ;
--CREDITS--
marcosptf - <marcosptf@yahoo.com.br> - #phparty7 - @phpsp - novatec/2015 - sao paulo - br
--SKIPIF--
@@ -53,30 +52,9 @@ Array
[comments] => %s
)
Array
(
[country_code] => %s
[latitude] => %f
[longitude] => %f
[comments] =>
)
Array
(
[country_code] => %s
[latitude] => %f
[longitude] => %f
[comments] => %s
)
Array
(
[country_code] => %s
[latitude] => %f
[longitude] => %f
[comments] => %s
)
Array
(
[country_code] => %s
[latitude] => %f
[longitude] => %f
[comments] =>
)
@@ -29,15 +29,15 @@ string(5) "array"
int(%d)
-- Format a sample entry --
array(11) {
array(12) {
[0]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(18) "America/Porto_Acre"
string(18) "Australia/Adelaide"
}
[1]=>
array(3) {
@@ -51,47 +51,47 @@ array(11) {
[2]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(16) "America/Eirunepe"
string(21) "Australia/Broken_Hill"
}
[3]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(18) "America/Rio_Branco"
string(16) "Australia/Darwin"
}
[4]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(11) "Brazil/Acre"
string(15) "Australia/North"
}
[5]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
int(32400)
["timezone_id"]=>
string(13) "Asia/Jayapura"
string(15) "Australia/South"
}
[6]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
int(32400)
["timezone_id"]=>
string(21) "Australia/Broken_Hill"
string(20) "Australia/Yancowinna"
}
[7]=>
array(3) {
@@ -100,7 +100,7 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(16) "Australia/Darwin"
string(21) "Australia/Broken_Hill"
}
[8]=>
array(3) {
@@ -109,7 +109,7 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/North"
string(16) "Australia/Darwin"
}
[9]=>
array(3) {
@@ -118,9 +118,18 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/South"
string(15) "Australia/North"
}
[10]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/South"
}
[11]=>
array(3) {
["dst"]=>
bool(false)
+1 -1
View File
@@ -5,7 +5,7 @@ date.timezone=Asia/Singapore
--FILE--
<?php
print strtotime('2008-05-23 00:00:00 SGT');
print strtotime('2008-05-23 00:00:00 +08');
print "\n";
print strtotime('2008-05-23 00:00:00');
+1 -1
View File
@@ -40,7 +40,7 @@ object(DateInterval)#%d (15) {
["special_amount"]=>
int(-1)
["have_weekday_relative"]=>
int(9)
int(%d)
["have_special_relative"]=>
int(0)
}
+22
View File
@@ -0,0 +1,22 @@
--TEST--
Bug #75002 Null Pointer Dereference in timelib_time_clone
--FILE--
<?php
class aaa extends DatePeriod {
public function __construct() { }
}
$start=new DateTime( '2012-08-01' );
foreach (new aaa($start) as $y) {
$a=$key;
}
?>
==DONE==
--EXPECTF--
Fatal error: Uncaught Error: DatePeriod has not been initialized correctly in %sbug75002.php:%d
Stack trace:
#0 {main}
thrown in %sbug75002.php on line %d
@@ -0,0 +1,16 @@
--TEST--
Test DateInterval props with dimension handling
--FILE--
<?php
class Z extends DateInterval{}
$z = new Z('P2Y4DT6H8M');
$i = 0;
$z->prop[1]=10;
while ($i < 1026) {
$z->prop[$i] = $i;
$i++;
}
?>
==NOCRASH==
--EXPECT--
==NOCRASH==
@@ -26,18 +26,18 @@ var_dump( $abbr["acst"] );
--EXPECTF--
*** Testing timezone_abbreviations_list() : basic functionality ***
string(5) "array"
int(%d)
int(142)
-- Format a sample entry --
array(11) {
array(12) {
[0]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(18) "America/Porto_Acre"
string(18) "Australia/Adelaide"
}
[1]=>
array(3) {
@@ -51,47 +51,47 @@ array(11) {
[2]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(16) "America/Eirunepe"
string(21) "Australia/Broken_Hill"
}
[3]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(18) "America/Rio_Branco"
string(16) "Australia/Darwin"
}
[4]=>
array(3) {
["dst"]=>
bool(true)
bool(false)
["offset"]=>
int(-14400)
int(32400)
["timezone_id"]=>
string(11) "Brazil/Acre"
string(15) "Australia/North"
}
[5]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
int(32400)
["timezone_id"]=>
string(13) "Asia/Jayapura"
string(15) "Australia/South"
}
[6]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
int(32400)
["timezone_id"]=>
string(21) "Australia/Broken_Hill"
string(20) "Australia/Yancowinna"
}
[7]=>
array(3) {
@@ -100,7 +100,7 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(16) "Australia/Darwin"
string(21) "Australia/Broken_Hill"
}
[8]=>
array(3) {
@@ -109,7 +109,7 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/North"
string(16) "Australia/Darwin"
}
[9]=>
array(3) {
@@ -118,9 +118,18 @@ array(11) {
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/South"
string(15) "Australia/North"
}
[10]=>
array(3) {
["dst"]=>
bool(false)
["offset"]=>
int(34200)
["timezone_id"]=>
string(15) "Australia/South"
}
[11]=>
array(3) {
["dst"]=>
bool(false)
@@ -24,11 +24,6 @@ var_dump( timezone_name_from_abbr("EDT") );
echo "-- Lookup with name and offset--\n";
var_dump( timezone_name_from_abbr("ADT", -10800) );
var_dump( timezone_name_from_abbr("ADT", 14400) );
var_dump( timezone_name_from_abbr("AKTT", 14400) );
var_dump( timezone_name_from_abbr("aktt", 18000) );
var_dump( timezone_name_from_abbr("Aktt", 21600) );
var_dump( timezone_name_from_abbr("AMST", -10800) );
var_dump( timezone_name_from_abbr("amst", 180000) );
echo "-- Tests without valid name - uses gmtOffset and isdst to find match --\n";
var_dump( timezone_name_from_abbr("", 3600, 1) );
@@ -51,12 +46,7 @@ string(13) "Europe/Berlin"
string(16) "America/New_York"
-- Lookup with name and offset--
string(15) "America/Halifax"
string(12) "Asia/Baghdad"
string(11) "Asia/Aqtobe"
string(11) "Asia/Aqtobe"
string(11) "Asia/Aqtobe"
string(17) "America/Boa_Vista"
string(12) "Asia/Yerevan"
string(15) "America/Halifax"
-- Tests without valid name - uses gmtOffset and isdst to find match --
string(13) "Europe/London"
string(17) "America/Sao_Paulo"
@@ -65,4 +55,4 @@ string(15) "America/Halifax"
-- Tests with invalid offsets --
bool(false)
bool(false)
===DONE===
===DONE===
+1 -1
View File
@@ -5,7 +5,7 @@ Test 5: HTML Test
--FILE--
<?php
$dom = new domdocument;
$dom->loadHTMLFile(dirname(__FILE__)."/test.html");
$dom->loadHTMLFile(dirname(__FILE__)."/test.html", LIBXML_NOBLANKS);
print "--- save as XML\n";
print adjustDoctype($dom->saveXML());
+5 -1
View File
@@ -323,7 +323,6 @@ PHP_MINFO_FUNCTION(enchant)
#elif defined(HAVE_ENCHANT_BROKER_SET_PARAM)
php_info_print_table_row(2, "Libenchant Version", "1.5.0 or later");
#endif
php_info_print_table_row(2, "Revision", "$Id$");
php_info_print_table_end();
php_info_print_table_start();
@@ -483,6 +482,11 @@ PHP_FUNCTION(enchant_broker_get_dict_path)
RETURN_FALSE;
}
if (value == NULL) {
php_error_docref(NULL, E_WARNING, "dict_path not set");
RETURN_FALSE;
}
RETURN_STRING(value);
}
/* }}} */
+1 -1
View File
@@ -24,7 +24,7 @@
extern zend_module_entry enchant_module_entry;
#define phpext_enchant_ptr &enchant_module_entry
#define PHP_ENCHANT_VERSION "1.1.0"
#define PHP_ENCHANT_VERSION PHP_VERSION
#ifdef PHP_WIN32
#define PHP_ENCHANT_API __declspec(dllexport)
+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #53070 (enchant_broker_get_path crashes if no path is set)
--SKIPIF--
<?php
if(!extension_loaded('enchant')) die('skip, enchant not loader');
if (!is_resource(enchant_broker_init())) {die("skip, resource dont load\n");}
?>
--FILE--
<?php
$broker = enchant_broker_init();
var_dump(enchant_broker_get_dict_path($broker, ENCHANT_MYSPELL));
var_dump(enchant_broker_get_dict_path($broker, ENCHANT_ISPELL));
?>
--EXPECTF--
Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
bool(false)
Warning: enchant_broker_get_dict_path(): dict_path not set in %s on line %d
bool(false)
+1 -1
View File
@@ -22,7 +22,7 @@
#if HAVE_EXIF
#include "php_version.h"
#define PHP_EXIF_VERSION "1.4 $Id: 8bdc0c8f27c2c9dd1f7551f1f9fe3ab57a06a4b1 $"
#define PHP_EXIF_VERSION PHP_VERSION
extern zend_module_entry exif_module_entry;
#define phpext_exif_ptr &exif_module_entry
+14
View File
@@ -0,0 +1,14 @@
--TEST--
Test exif_read_data on unavailable file
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
$infile = dirname(__FILE__).'/bug73115.JPG';
exif_read_data($infile);
?>
===DONE===
--EXPECTF--
Warning: exif_read_data(): Unable to open file in %sexif_read_data_0.php on line %d
===DONE===
+1 -1
View File
@@ -1,2 +1,2 @@
fileinfo
Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans
Ilia Alshanetsky, Pierre Alain Joye, Scott MacVicar, Derick Rethans, Anatol Belski
+1
View File
@@ -377,6 +377,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_imagewebp, 0, 0, 1)
ZEND_ARG_INFO(0, im)
ZEND_ARG_INFO(0, filename)
ZEND_ARG_INFO(0, quality)
ZEND_END_ARG_INFO()
#endif
+7
View File
@@ -53,12 +53,17 @@ int gdImageGrayScale(gdImagePtr src)
int new_pxl, pxl;
typedef int (*FuncPtr)(gdImagePtr, int, int);
FuncPtr f;
int alpha_blending;
f = GET_PIXEL_FUNCTION(src);
if (src==NULL) {
return 0;
}
alpha_blending = src->alphaBlendingFlag;
gdImageAlphaBlending(src, gdEffectReplace);
for (y=0; y<src->sy; ++y) {
for (x=0; x<src->sx; ++x) {
pxl = f (src, x, y);
@@ -75,6 +80,8 @@ int gdImageGrayScale(gdImagePtr src)
gdImageSetPixel (src, x, y, new_pxl);
}
}
gdImageAlphaBlending(src, alpha_blending);
return 1;
}
+5 -5
View File
@@ -261,10 +261,6 @@ terminated:
if (!im) {
return 0;
}
if (!im->colorsTotal) {
gdImageDestroy(im);
return 0;
}
/* Check for open colors at the end, so
we can reduce colorsTotal and ultimately
BitsPerPixel */
@@ -275,6 +271,10 @@ terminated:
break;
}
}
if (!im->colorsTotal) {
gdImageDestroy(im);
return 0;
}
return im;
}
/* }}} */
@@ -375,7 +375,7 @@ static int
GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroDataBlockP)
{
int i, j, ret;
unsigned char count;
int count;
if (flag) {
scd->curbit = 0;
+77 -24
View File
@@ -66,6 +66,16 @@ TODO:
# include <emmintrin.h>
#endif
#ifndef HAVE_FLOORF
# define HAVE_FLOORF 0
#endif
#if HAVE_FLOORF == 0
# ifndef floorf
/* float floorf(float x);*/
# define floorf(x) ((float)(floor(x)))
# endif
#endif
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
#endif
@@ -1709,13 +1719,28 @@ gdImagePtr gdImageScale(const gdImagePtr src, const unsigned int new_width, cons
return im_scaled;
}
static int gdRotatedImageSize(gdImagePtr src, const float angle, gdRectPtr bbox)
{
gdRect src_area;
double m[6];
gdAffineRotate(m, angle);
src_area.x = 0;
src_area.y = 0;
src_area.width = gdImageSX(src);
src_area.height = gdImageSY(src);
if (gdTransformAffineBoundingBox(&src_area, m, bbox) != GD_TRUE) {
return GD_FALSE;
}
return GD_TRUE;
}
gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, const int bgColor)
{
float _angle = ((float) (-degrees / 180.0f) * (float)M_PI);
const int src_w = gdImageSX(src);
const int src_h = gdImageSY(src);
const unsigned int new_width = (unsigned int)(abs((int)(src_w * cos(_angle))) + abs((int)(src_h * sin(_angle))) + 0.5f);
const unsigned int new_height = (unsigned int)(abs((int)(src_w * sin(_angle))) + abs((int)(src_h * cos(_angle))) + 0.5f);
const gdFixed f_0_5 = gd_ftofx(0.5f);
const gdFixed f_H = gd_itofx(src_h/2);
const gdFixed f_W = gd_itofx(src_w/2);
@@ -1726,6 +1751,12 @@ gdImagePtr gdImageRotateNearestNeighbour(gdImagePtr src, const float degrees, co
unsigned int dst_offset_y = 0;
unsigned int i;
gdImagePtr dst;
gdRect bbox;
int new_height, new_width;
gdRotatedImageSize(src, degrees, &bbox);
new_width = bbox.width;
new_height = bbox.height;
if (new_width == 0 || new_height == 0) {
return NULL;
@@ -1768,8 +1799,6 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
const int angle_rounded = (int)floor(degrees * 100);
const int src_w = gdImageSX(src);
const int src_h = gdImageSY(src);
const unsigned int new_width = (unsigned int)(abs((int)(src_w * cos(_angle))) + abs((int)(src_h * sin(_angle))) + 0.5f);
const unsigned int new_height = (unsigned int)(abs((int)(src_w * sin(_angle))) + abs((int)(src_h * cos(_angle))) + 0.5f);
const gdFixed f_0_5 = gd_ftofx(0.5f);
const gdFixed f_H = gd_itofx(src_h/2);
const gdFixed f_W = gd_itofx(src_w/2);
@@ -1780,11 +1809,13 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
unsigned int dst_offset_y = 0;
unsigned int i;
gdImagePtr dst;
int new_width, new_height;
gdRect bbox;
const gdFixed f_slop_y = f_sin;
const gdFixed f_slop_x = f_cos;
const gdFixed f_slop = f_slop_x > 0 && f_slop_x > 0 ?
f_slop_x > f_slop_y ? gd_divfx(f_slop_y, f_slop_x) : gd_divfx(f_slop_x, f_slop_y)
const gdFixed f_slop = f_slop_x > 0 && f_slop_y > 0 ?
(f_slop_x > f_slop_y ? gd_divfx(f_slop_y, f_slop_x) : gd_divfx(f_slop_x, f_slop_y))
: 0;
@@ -1792,6 +1823,10 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const float degrees, const int b
return NULL;
}
gdRotatedImageSize(src, degrees, &bbox);
new_width = bbox.width;
new_height = bbox.height;
dst = gdImageCreateTrueColor(new_width, new_height);
if (!dst) {
return NULL;
@@ -1831,8 +1866,7 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
float _angle = (float)((- degrees / 180.0f) * M_PI);
const unsigned int src_w = gdImageSX(src);
const unsigned int src_h = gdImageSY(src);
unsigned int new_width = abs((int)(src_w*cos(_angle))) + abs((int)(src_h*sin(_angle) + 0.5f));
unsigned int new_height = abs((int)(src_w*sin(_angle))) + abs((int)(src_h*cos(_angle) + 0.5f));
unsigned int new_width, new_height;
const gdFixed f_0_5 = gd_ftofx(0.5f);
const gdFixed f_H = gd_itofx(src_h/2);
const gdFixed f_W = gd_itofx(src_w/2);
@@ -1844,6 +1878,12 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
unsigned int dst_offset_y = 0;
unsigned int src_offset_x, src_offset_y;
gdImagePtr dst;
gdRect bbox;
gdRotatedImageSize(src, degrees, &bbox);
new_width = bbox.width;
new_height = bbox.height;
dst = gdImageCreateTrueColor(new_width, new_height);
if (dst == NULL) {
@@ -1863,7 +1903,7 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
const unsigned int m = gd_fxtoi(f_m);
const unsigned int n = gd_fxtoi(f_n);
if ((m > 0) && (m < src_h - 1) && (n > 0) && (n < src_w - 1)) {
if ((m >= 0) && (m < src_h - 1) && (n >= 0) && (n < src_w - 1)) {
const gdFixed f_f = f_m - gd_itofx(m);
const gdFixed f_g = f_n - gd_itofx(n);
const gdFixed f_w1 = gd_mulfx(f_1-f_f, f_1-f_g);
@@ -1871,11 +1911,6 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
const gdFixed f_w3 = gd_mulfx(f_f, f_1-f_g);
const gdFixed f_w4 = gd_mulfx(f_f, f_g);
if (n < src_w - 1) {
src_offset_x = n + 1;
src_offset_y = m;
}
if (m < src_h-1) {
src_offset_x = n;
src_offset_y = m + 1;
@@ -1890,13 +1925,13 @@ gdImagePtr gdImageRotateBilinear(gdImagePtr src, const float degrees, const int
register int pixel2, pixel3, pixel4;
if (src_offset_y + 1 >= src_h) {
pixel2 = bgColor;
pixel3 = bgColor;
pixel4 = bgColor;
pixel2 = pixel1;
pixel3 = pixel1;
pixel4 = pixel1;
} else if (src_offset_x + 1 >= src_w) {
pixel2 = bgColor;
pixel3 = bgColor;
pixel4 = bgColor;
pixel2 = pixel1;
pixel3 = pixel1;
pixel4 = pixel1;
} else {
pixel2 = src->tpixels[src_offset_y][src_offset_x + 1];
pixel3 = src->tpixels[src_offset_y + 1][src_offset_x];
@@ -1946,8 +1981,7 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
const float _angle = (float)((- degrees / 180.0f) * M_PI);
const int src_w = gdImageSX(src);
const int src_h = gdImageSY(src);
const unsigned int new_width = abs((int)(src_w*cos(_angle))) + abs((int)(src_h*sin(_angle) + 0.5f));
const unsigned int new_height = abs((int)(src_w*sin(_angle))) + abs((int)(src_h*cos(_angle) + 0.5f));
unsigned int new_width, new_height;
const gdFixed f_0_5 = gd_ftofx(0.5f);
const gdFixed f_H = gd_itofx(src_h/2);
const gdFixed f_W = gd_itofx(src_w/2);
@@ -1963,7 +1997,11 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
unsigned int dst_offset_y = 0;
unsigned int i;
gdImagePtr dst;
gdRect bbox;
gdRotatedImageSize(src, degrees, &bbox);
new_width = bbox.width;
new_height = bbox.height;
dst = gdImageCreateTrueColor(new_width, new_height);
if (dst == NULL) {
@@ -2206,8 +2244,11 @@ gdImagePtr gdImageRotateBicubicFixed(gdImagePtr src, const float degrees, const
gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, int bgcolor)
{
const int angle_rounded = (int)floor(angle * 100);
/* round to two decimals and keep the 100x multiplication to use it in the common square angles
case later. Keep the two decimal precisions so smaller rotation steps can be done, useful for
slow animations, f.e. */
const int angle_rounded = fmod((int) floorf(angle * 100), 360 * 100);
if (bgcolor < 0) {
return NULL;
}
@@ -2224,6 +2265,18 @@ gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, in
/* no interpolation needed here */
switch (angle_rounded) {
case 0: {
gdImagePtr dst = gdImageCreateTrueColor(src->sx, src->sy);
if (dst == NULL) {
return NULL;
}
dst->transparent = src->transparent;
dst->saveAlphaFlag = 1;
dst->alphaBlendingFlag = gdEffectReplace;
gdImageCopy(dst, src, 0,0,0,0,src->sx,src->sy);
return dst;
}
case -27000:
case 9000:
return gdImageRotate90(src, 0);
+4 -1
View File
@@ -164,7 +164,10 @@ readwbmp (int (*getin) (void *in), void *in, Wbmp ** return_wbmp)
}
if (skipheader (getin, in))
return (-1);
{
gdFree (wbmp);
return (-1);
}
wbmp->width = getmbi (getin, in);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

+179
View File
@@ -0,0 +1,179 @@
--TEST--
Bug #65148 (imagerotate may alter image dimensions)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension is not available');
?>
--FILE--
<?php
$interpolations = array(
'IMG_BELL' => IMG_BELL,
'IMG_BESSEL' => IMG_BESSEL,
'IMG_BICUBIC' => IMG_BICUBIC,
'IMG_BICUBIC_FIXED' => IMG_BICUBIC_FIXED,
'IMG_BILINEAR_FIXED' => IMG_BILINEAR_FIXED,
'IMG_BLACKMAN' => IMG_BLACKMAN,
'IMG_BOX' => IMG_BOX,
'IMG_BSPLINE' => IMG_BSPLINE,
'IMG_CATMULLROM' => IMG_CATMULLROM,
'IMG_GAUSSIAN' => IMG_GAUSSIAN,
'IMG_GENERALIZED_CUBIC' => IMG_GENERALIZED_CUBIC,
'IMG_HERMITE' => IMG_HERMITE,
'IMG_HAMMING' => IMG_HAMMING,
'IMG_HANNING' => IMG_HANNING,
'IMG_MITCHELL' => IMG_MITCHELL,
'IMG_POWER' => IMG_POWER,
'IMG_QUADRATIC' => IMG_QUADRATIC,
'IMG_SINC' => IMG_SINC,
'IMG_NEAREST_NEIGHBOUR' => IMG_NEAREST_NEIGHBOUR,
'IMG_WEIGHTED4' => IMG_WEIGHTED4,
'IMG_TRIANGLE' => IMG_TRIANGLE,
);
$img = imagecreate(40, 20);
$results = array();
foreach ($interpolations as $name => $interpolation) {
imagesetinterpolation($img, $interpolation);
$t = imagecolorallocatealpha($img, 0, 0, 0, 127);
$imgr = imagerotate($img, -5, $t);
$results[$name] = array('x' => imagesx($imgr), 'y' => imagesy($imgr));
imagedestroy($imgr);
}
imagedestroy($img);
print_r($results);
?>
===DONE===
--EXPECT--
Array
(
[IMG_BELL] => Array
(
[x] => 40
[y] => 23
)
[IMG_BESSEL] => Array
(
[x] => 40
[y] => 23
)
[IMG_BICUBIC] => Array
(
[x] => 40
[y] => 23
)
[IMG_BICUBIC_FIXED] => Array
(
[x] => 40
[y] => 23
)
[IMG_BILINEAR_FIXED] => Array
(
[x] => 40
[y] => 23
)
[IMG_BLACKMAN] => Array
(
[x] => 40
[y] => 23
)
[IMG_BOX] => Array
(
[x] => 40
[y] => 23
)
[IMG_BSPLINE] => Array
(
[x] => 40
[y] => 23
)
[IMG_CATMULLROM] => Array
(
[x] => 40
[y] => 23
)
[IMG_GAUSSIAN] => Array
(
[x] => 40
[y] => 23
)
[IMG_GENERALIZED_CUBIC] => Array
(
[x] => 40
[y] => 23
)
[IMG_HERMITE] => Array
(
[x] => 40
[y] => 23
)
[IMG_HAMMING] => Array
(
[x] => 40
[y] => 23
)
[IMG_HANNING] => Array
(
[x] => 40
[y] => 23
)
[IMG_MITCHELL] => Array
(
[x] => 40
[y] => 23
)
[IMG_POWER] => Array
(
[x] => 40
[y] => 23
)
[IMG_QUADRATIC] => Array
(
[x] => 40
[y] => 23
)
[IMG_SINC] => Array
(
[x] => 40
[y] => 23
)
[IMG_NEAREST_NEIGHBOUR] => Array
(
[x] => 40
[y] => 23
)
[IMG_WEIGHTED4] => Array
(
[x] => 40
[y] => 23
)
[IMG_TRIANGLE] => Array
(
[x] => 40
[y] => 23
)
)
===DONE===
Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 741 B

+4
View File
@@ -1,5 +1,9 @@
--TEST--
(Bug #74031) ReflectionFunction for imagepng returns wrong number of parameters
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available\n");
?>
--FILE--
<?php
+31
View File
@@ -0,0 +1,31 @@
--TEST--
Bug #75124 (gdImageGrayScale() may produce colors)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('gd extension not available');
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.5', '<')) {
die('skip only for bundled libgd or external libgd >= 2.2.5');
}
?>
--FILE--
<?php
$im = imagecreatefrompng(__DIR__ . '/bug75124.png');
var_dump(imageistruecolor($im));
imagefilter($im, IMG_FILTER_GRAYSCALE);
for ($i = 0, $width = imagesx($im); $i < $width; $i ++) {
for ($j = 0, $height = imagesy($im); $j < $height; $j++) {
$color = imagecolorat($im, $i, $j);
$red = ($color >> 16) & 0xff;
$green = ($color >> 8) & 0xff;
$blue = $color & 0xff;
if ($red != $green || $green != $blue) {
echo "non grayscale pixel detected\n";
break 2;
}
}
}
?>
===DONE===
--EXPECT--
bool(true)
===DONE===
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

+20
View File
@@ -0,0 +1,20 @@
--TEST--
Bug #75437 Wrong reflection on imagewebp
--SKIPIF--
<?php
if (!extension_loaded('reflection')) die('skip reflection not available');
if (!extension_loaded('gd')) die('skip gd extension not available');
if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.0', '<')) die("skip test requires GD 2.2.0 or higher");
if (!function_exists('imagewebp')) die('skip WebP support not available');
?>
--FILE--
<?php
$rf = new ReflectionFunction('imagewebp');
var_dump($rf->getNumberOfParameters());
var_dump($rf->getNumberOfRequiredParameters());
?>
===DONE===
--EXPECT--
int(3)
int(1)
===DONE===
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #75571 (Infinite loop in GIF reading causing DoS)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
var_dump(imagecreatefromgif(__DIR__ . '/bug75571.gif'));
?>
===DONE===
--EXPECTF--
Warning: imagecreatefromgif(): '%s' is not a valid GIF file in %s on line %d
bool(false)
===DONE===
+4 -4
View File
@@ -161,16 +161,16 @@ PHP_MINFO_FUNCTION(php_gettext)
Set the textdomain to "domain". Returns the current domain */
PHP_NAMED_FUNCTION(zif_textdomain)
{
char *domain, *domain_name, *retval;
size_t domain_len;
char *domain = NULL, *domain_name, *retval;
size_t domain_len = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &domain, &domain_len) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS(), "s!", &domain, &domain_len) == FAILURE) {
return;
}
PHP_GETTEXT_DOMAIN_LENGTH_CHECK
if (strcmp(domain, "") && strcmp(domain, "0")) {
if (domain != NULL && strcmp(domain, "") && strcmp(domain, "0")) {
domain_name = domain;
} else {
domain_name = NULL;
+16
View File
@@ -0,0 +1,16 @@
--TEST--
Bug #73730 (textdomain(null) throws in strict mode)
--SKIPIF--
<?php
if (!extension_loaded('gettext')) die('skip gettext extension is not available');
?>
--FILE--
<?php
declare(strict_types=1);
var_dump(textdomain(null));
?>
===DONE===
--EXPECT--
string(8) "messages"
===DONE===
Loaded 100 of 311 files, more files were not shown because too many files have changed in this diff. Show more