Compare commits

...
213 Commits
Author SHA1 Message Date
Christoph M. Becker 4c6de12b2d Update for PHP 7.3.7RC1 2019-06-11 12:26:00 +02:00
Christoph M. Becker b215d1339f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77937: preg_match failed
2019-06-11 08:44:07 +02:00
Christoph M. Becker f3ff72e54b Fix #77937: preg_match failed
On some recent Windows systems, ext\pcre\tests\locales.phpt fails,
because 'pt_PT' is accepted by `setlocale()`, but not properly
supported by the ctype functions, which are used internally by PCRE2 to
build the localized character tables.

Since there appears to be no way to properly check whether a given
locale is fully supported, but we want to minimize BC impact, we filter
out typical Unix locale names, except for a few cases which have
already been properly supported on Windows.  This way code like

  setlocale(LC_ALL, 'de_DE.UTF-8', 'de_DE', 'German_Germany.1252');

should work like on older Windows systems.

It should be noted that the locale names causing trouble are not (yet)
documented as valid names anyway, see
<https://docs.microsoft.com/en-us/cpp/c-runtime-library/locale-names-languages-and-country-region-strings?view=vs-2019>.
2019-06-11 08:42:32 +02:00
Dmitry Stogov a0749fe483 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed possible misalignment in 32-bit build.
2019-06-10 12:52:50 +03:00
Dmitry Stogov 199eb2b110 Fixed possible misalignment in 32-bit build. 2019-06-10 12:51:59 +03:00
Peter Kokot 53b0f4ba4e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Extend wildcard files section in EditorConfig [ci skip]
2019-06-09 22:54:59 +02:00
Peter Kokot 65ada39360 Extend wildcard files section in EditorConfig [ci skip]
Changes:
- Trim trailing whitespace for all files except patches. There isn't
  really any practical reason to not trim the trailing whitespace in all
  other files. Binary files or phpt files that include trailing
  whitespace as part of the test should be manually set in editors/IDEs
  or by disabling the editorconfig for particular editing.
- Add *.ac, *.d, *.l, *.skl, *.re, *.wsdl, *.dtd, *.html, *.rng, *.xml,
  *.xsd, *.xsl, buildconf, and Makefile* files settings.

Closes #4156
2019-06-09 22:53:58 +02:00
Dmitry Stogov 15e01132cf Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Restored NEWS entry
2019-06-07 12:38:37 +03:00
Dmitry Stogov 10b208f28d Restored NEWS entry 2019-06-07 12:37:49 +03:00
Nikita Popov 9569a0b8ca Merge branch 'PHP-7.2' into PHP-7.3 2019-06-07 10:57:43 +02:00
Nikita Popov d7c7522be9 Enable STRICT_TRANS_TABLES in new test
The part testing error cases relies on this.
2019-06-07 10:57:09 +02:00
Dmitry Stogov 972223c342 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77135 (Extract with EXTR_SKIP should skip $this)
2019-06-07 11:48:57 +03:00
Dmitry Stogov 83cdb89f8a Fixed bug #77135 (Extract with EXTR_SKIP should skip $this) 2019-06-07 11:36:39 +03:00
Nikita Popov a5f98139c9 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-07 09:49:01 +02:00
Cameron Porter 7d1aa7534d Fixed bug #38546
Properly support binding boolean parameters with emulated prepared
statements disabled. Also add the necessary mysqlnd support for
MYSQL_TYPE_TINY.
2019-06-07 09:48:43 +02:00
Christoph M. Becker 5f2f6180b9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test regarding Unix Domain Sockets on Windows
2019-06-06 15:00:35 +02:00
Christoph M. Becker 2df32942d3 Fix test regarding Unix Domain Sockets on Windows
Recent Windows versions actually support Unix Domain Sockets.  Cf.
<https://github.com/curl/curl/pull/3939>.
2019-06-06 14:59:58 +02:00
Christoph M. Becker 22a3fa0b2e Fix #78114: segfault when calling sodium_* functions from eval
We must not follow the NULL pointer.
2019-06-06 10:00:15 +02:00
Joe Watkins 249c20023d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  fix flaky posix test
2019-06-05 16:35:43 +02:00
Joe Watkins f4474e5724 fix flaky posix test 2019-06-05 16:34:50 +02:00
Nikita Popov d154301866 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-04 16:27:57 +02:00
Nikita Popov a3e6b50442 Fixed bug #78050
This is a backport of a982125561.
2019-06-04 16:26:34 +02:00
Nikita Popov a4633b13d4 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-04 16:14:14 +02:00
Nikita Popov 2d3bc71e89 Reload tsrmls_id in release builds as well
If TSRM is shut down and started again (something that phpdbg does),
then tsrmls_id needs to be reloaded everywhere. As tsrmls_id
update is a rare operation, doing that shouldn't be a problem.
2019-06-04 16:12:59 +02:00
Remi Collet 9a495911c8 this was in 7.3.5, not 7.3.6 2019-06-04 07:19:29 +02:00
Nikita Popov 37bba7a678 Merge branch 'PHP-7.2' into PHP-7.3 2019-06-03 15:15:07 +02:00
Nikita Popov ac60007bec Clear errors after SSL_CTX_load_verify_locations()
We report our own errors here. Make sure these don't clog up the
error queue.
2019-06-03 15:14:01 +02:00
Jakub Zelenka 8f69ca8dcd Merge branch 'PHP-7.2' into PHP-7.3 2019-06-02 19:13:18 +01:00
Jakub Zelenka 2e02579474 Fix bug #78079 (openssl_encrypt_ccm.phpt fails with OpenSSL 1.1.1c)
It also fixes invalid setting of tag length
2019-06-02 19:10:56 +01:00
Anatol Belski 793fd6bce9 Fix expect section 2019-06-01 14:50:14 +02:00
Anatol Belski 547665c720 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update SDK version for AppVeyor
2019-06-01 13:44:10 +02:00
Anatol Belski 59b0b38d3c Update SDK version for AppVeyor 2019-06-01 13:43:31 +02:00
Anatol Belski 2205546edf Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Change ZPP only if compiled with ICU >= 64
  Update tests for ICU 64
2019-06-01 02:26:07 +02:00
Anatol Belski ee153deb1f Change ZPP only if compiled with ICU >= 64 2019-06-01 02:18:56 +02:00
Nikita Popov b01d9fdab1 Update tests for ICU 64
(cherry picked from commit 8a8bc5c452)
2019-06-01 02:17:16 +02:00
Anatol Belski 06eef1f70f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix var name
2019-05-31 20:50:17 +02:00
Anatol Belski d293f6dcff Fix var name 2019-05-31 20:49:42 +02:00
Craig Duncan 370997fb5d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add a test for bug #65672
  Ensure the internal properties cannot be overwritten
2019-05-30 18:55:55 +01:00
Craig Duncan 8b53c7232e Add a test for bug #65672 2019-05-30 18:55:42 +01:00
Craig Duncan dc586bff36 Ensure the internal properties cannot be overwritten 2019-05-30 18:55:36 +01:00
Nikita Popov 61a38bb274 SCCP: Fix leak when determining TYPE_CHECK from type info
As TYPE_CHECK is the only opcode where we do something like this,
I'm adding this hack.
2019-05-29 16:47:19 +02:00
Nikita Popov de7d0256a3 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-29 09:47:43 +02:00
Craig Duncan 5d67271db0 Add tests for DatePeriod properties 2019-05-29 09:47:10 +02:00
Christoph M. Becker f3cd6931ca Update NEWS for 7.3.6 2019-05-29 09:27:23 +02:00
Remi Collet 582469eef2 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  add NEWS entries for sec fix
2019-05-29 08:53:42 +02:00
Remi Collet 3051147019 add NEWS entries for sec fix 2019-05-29 08:53:23 +02:00
Joe Watkins 6c73b2088a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  disabled functions must not have return type
2019-05-29 08:30:41 +02:00
Joe Watkins 7821cc3b9f disabled functions must not have return type 2019-05-29 08:30:08 +02:00
Craig Duncan 72c330f1e6 Restore the execute bit for run-tests.php
It looks like this was accidentally removed in 03f15f705a
2019-05-28 21:51:26 +01:00
Nikita Popov 817b50826e Merge branch 'PHP-7.2' into PHP-7.3 2019-05-28 16:41:08 +02:00
Nikita Popov 59dfaa3f99 Fix type inference of SEND_UNPACK with empty array
An empty array will not be turned into an array of references.
This violated the invariant than an array has values iff it has
keys.
2019-05-28 16:40:56 +02:00
Joe Watkins dee977b7a7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  bump version after release
2019-05-28 09:54:15 +02:00
Joe Watkins d661a75d54 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  bump version after release
2019-05-28 09:53:32 +02:00
Joe Watkins 5533f2490a bump version after release 2019-05-28 09:52:52 +02:00
Stanislav Malyshev 9d473f1eac Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77967 - Bypassing open_basedir restrictions via file uris
2019-05-27 21:36:05 -07:00
Stanislav Malyshev fbb6a27212 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77967 - Bypassing open_basedir restrictions via file uris
2019-05-27 21:36:00 -07:00
Stanislav Malyshev c34895e837 Fix bug #77967 - Bypassing open_basedir restrictions via file uris 2019-05-27 18:48:48 -07:00
Stanislav Malyshev 13dffa9d32 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
2019-05-27 17:28:25 -07:00
Stanislav Malyshev dc1d99e772 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77988 - heap-buffer-overflow on php_jpg_get16
2019-05-27 17:28:20 -07:00
Stanislav Malyshev 73ff4193be Fix bug #77988 - heap-buffer-overflow on php_jpg_get16 2019-05-27 17:28:09 -07:00
Stanislav Malyshev e63b2ba310 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix function name
2019-05-27 17:21:23 -07:00
Stanislav Malyshev 9bca9ef6cf Fix function name 2019-05-27 17:20:56 -07:00
Stanislav Malyshev c7eb0feed8 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow
  Fix #77973: Uninitialized read in gdImageCreateFromXbm
2019-05-27 16:49:25 -07:00
Stanislav Malyshev e77c8e45ba Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Update NEWS
  Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow
  Fix #77973: Uninitialized read in gdImageCreateFromXbm
2019-05-27 16:49:19 -07:00
Stanislav Malyshev 16e037bd46 Update NEWS 2019-05-27 16:48:32 -07:00
Stanislav Malyshev 7cf7148a8f Fix bug #78069 - Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow 2019-05-27 16:32:42 -07:00
Christoph M. Becker ed6dee9a19 Fix #77973: Uninitialized read in gdImageCreateFromXbm
We have to ensure that `sscanf()` does indeed read a hex value here,
and bail out otherwise.
2019-05-27 16:11:32 -07:00
Nikita Popov 0cb43ec51c Merge branch 'PHP-7.2' into PHP-7.3 2019-05-27 17:43:13 +02:00
Michael Maroszek a0c9d0849a Fixed bug #76345 2019-05-27 17:42:20 +02:00
Nikita Popov 31ce1cbbb9 Func info: Fix calls to zero-arg varargs
The num_args does not include variadics, so a "zero-arg" function
may accept additional arguments through that. No functions seem
to be affected right now, but they will be after #4175.
2019-05-27 16:14:51 +02:00
Jakub Zelenka 209b12e064 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-26 18:49:52 +01:00
Jakub Zelenka 8baf3ffde6 Add fpmi to the opcache supported sapis 2019-05-26 18:47:22 +01:00
Nikita Popov 6f9dfd9473 Fix bug #77955
Free metadata before freeing the arena. I don't have a repro script,
but the added assertion fails for many existing tests prior to this
change.
2019-05-23 13:40:52 +02:00
Nikita Popov b394654c1e Merge branch 'PHP-7.2' into PHP-7.3 2019-05-23 11:12:59 +02:00
Nikita Popov 9a74b23297 Fixed bug #78038 socket_select with references 2019-05-23 11:12:15 +02:00
Dmitry Stogov d4867e099e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed race condition in opcache restart
2019-05-23 00:21:04 +03:00
Dmitry Stogov fa6a4483e6 Fixed race condition in opcache restart 2019-05-23 00:20:35 +03:00
Dmitry Stogov aa9c76d027 Fixed dump of constant flags 2019-05-22 22:59:40 +03:00
Nikita Popov f308aa4e1e Merge branch 'PHP-7.2' into PHP-7.3 2019-05-22 12:45:16 +02:00
Sjon Hortensius 96404eb8e2 Fix #77956 - When mysqli.allow_local_infile = Off, return a client error 2019-05-22 12:44:55 +02:00
Christoph M. Becker 69c634a56d Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test case for cURL 7.65.0
2019-05-22 12:02:03 +02:00
Christoph M. Becker 62fe6ba20c Fix test case for cURL 7.65.0
Reported and patch provided by @Jan-E.
2019-05-22 12:01:23 +02:00
Nikita Popov 3a719696bc Merge branch 'PHP-7.2' into PHP-7.3 2019-05-22 11:43:26 +02:00
Nikita Popov 3a0de243c3 Use a different URL in bug44811.phpt 2019-05-22 11:41:51 +02:00
Rasmus Lerdorf 2d29263a9f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix precedence issue causing sub-second timeouts to be 0 in curl_multi_select
2019-05-21 14:46:24 -07:00
Rasmus Lerdorf 7b42cdf95e Fix precedence issue causing sub-second timeouts to be 0 in
curl_multi_select
2019-05-21 14:44:11 -07:00
Nikita Popov 97ba6b0d8b Don't evaluate functions with partial array arguments 2019-05-21 17:35:03 +02:00
Nikita Popov 30f1b17262 Fix null check in sccp add_array_elem chain handling
We need to check result_use rather than result_def for a null zval.
Previously we were later assuming that the null zval is really a
partial array, which does not go well.
2019-05-21 17:15:07 +02:00
Nikita Popov fc4836b193 Fix partial array handling in FE_RESET edge feasibility 2019-05-21 16:59:27 +02:00
Nikita Popov cd188d0398 Handle partial arrays in zend_is_true() checks 2019-05-21 16:53:34 +02:00
Nikita Popov bdce5849b7 Extract ct_eval_binary_op()
And use it in more places, though some of them are currently not
reachable by partial arrays to the best of my knowledge.
2019-05-21 16:43:41 +02:00
Nikita Popov 367788cbc3 Improve SCCP debug code
In particular properly dump partial arrays when tracing execution.
2019-05-21 16:42:13 +02:00
Christoph M. Becker d23bc33dc1 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Prevent test case failure
2019-05-21 11:18:32 +02:00
Christoph M. Becker e6a191de1b Prevent test case failure
If opcache.log_verbosity_level is greater than 1, opcache will raise
warnings, which will be written to stderr in the default case.  These
warnings are actually to be expected, but would break the test, so we
make sure that the log_verbosity_level is 1 when running this test.
2019-05-21 11:17:51 +02:00
Nikita Popov 4ebd9a5366 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-21 10:04:51 +02:00
Vincent JARDIN 5f8c22d415 Support content_type stream context option in soap
Allows overriding the HTTP header using the HTTP context:

    $client = new SoapClient('http://url.wsdl&v=latest', [
      'stream_context' => stream_context_create([
        'http' => [
          'content_type' => 'foobarX',
        ],
      ]),
    ]);

This is a backport of c55af3c65a
to the PHP 7.2 branch.
2019-05-21 10:04:15 +02:00
Christoph M. Becker 11740abd6b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  use {TMP} placeholder in phpt tests
2019-05-21 09:03:01 +02:00
Holly Li (WIPRO LIMITED) 202e6936d6 use {TMP} placeholder in phpt tests 2019-05-21 09:02:37 +02:00
Dmitry Stogov 354a76bb80 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Prevent race condition in opcache_reset()
2019-05-21 00:08:03 +03:00
Dmitry Stogov a8a019d68a Prevent race condition in opcache_reset() 2019-05-21 00:07:17 +03:00
Christoph M. Becker db8ef71353 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test wrt. opcache.error_log
2019-05-20 11:10:20 +02:00
Christoph M. Becker 64ec9f4dbe Fix test wrt. opcache.error_log
Since the test expects log messages to be written to stderr, we have to
make sure that opcache.error_log is set correctly when running the
test.
2019-05-20 11:09:44 +02:00
Christoph M. Becker fd607635a4 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #78025: segfault when accessing properties of DOMDocumentType
2019-05-17 13:32:13 +02:00
Christoph M. Becker e246dea9fe Fix #78025: segfault when accessing properties of DOMDocumentType
Instead of following the NULL pointer, we return an empty string.
2019-05-17 13:31:18 +02:00
Nikita Popov 9d76fbd0c4 Fixed bug #78015
Don't try to evaluate various operations with partial array operands.
We could evaluate some of these, but let's be conservative for now...
2019-05-15 14:35:31 +02:00
Nikita Popov 5846119e50 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-15 12:48:35 +02:00
Nikita Popov 35353dc49a Fixed bug #76980
If we perform a class fetch that is not marked as exception safe,
convert exceptions thrown by autoloaders into a fatal error.

Ideally fetching the interfaces would be exception safe, but as it
isn't right now, we must abort at this point.
2019-05-15 12:46:23 +02:00
Christoph M. Becker 714d2d8ae1 Update NEWS regarding re-tagging 7.3.6RC1 2019-05-15 11:31:53 +02:00
Sara Golemon 8511c204c3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Bump for 7.2.20
2019-05-14 20:23:25 -04:00
Sara Golemon 4fa32d67bf Bump for 7.2.20 2019-05-14 20:22:00 -04:00
Dmitry Stogov bb7ecb8704 Moved NEWS entry 2019-05-14 14:55:28 +03:00
Dmitry Stogov a43678aa12 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed possible crashes, because of inconsistent PCRE cache and opcache SHM reset
2019-05-14 14:54:30 +03:00
Dmitry Stogov 5c4d125d4c Fixed possible crashes, because of inconsistent PCRE cache and opcache SHM reset 2019-05-14 14:53:52 +03:00
Christoph M. Becker 2d93cce03a Prepare 7.3.7-dev 2019-05-14 11:44:58 +02:00
Christoph M. Becker 1a98878bfe Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix test case
2019-05-14 10:25:02 +02:00
Christoph M. Becker 704a0ab0c9 Fix test case
stderr is supposed to be redirected to NUL (which is roughly equivalent
to /dev/null on POSIX), but actually was redirected to a file.
2019-05-14 10:23:58 +02:00
Jakub Zelenka aa74c30466 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-13 18:51:05 +01:00
Jakub Zelenka ad63bd169b Add ping to the fpm test for bug #77934 2019-05-13 18:50:24 +01:00
Christoph M. Becker 69bab6e5a5 Fix #78003: strip_tags output change since PHP 7.3
A refactoring of the strip tags state machine[1] missed the special
treatment of `depth > 0` when a `>` is encountered in state 2 or 3.  We
re-add it for BC reasons.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=5cf64742773ddbf9af69d962a4d12b567fcf0084>
2019-05-13 13:10:24 +02:00
Nikita Popov bec68d59a2 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-13 11:06:14 +02:00
Theodore Brown b6b15fc65c Fix #77993: Wrong parse error for invalid hex literal on Windows
If a PHP file contains an invalid hex literal such as `0x_10`, the expected error
is `Parse error: syntax error, unexpected 'x_10' (T_STRING) in %s on line %d`.

This already worked correctly on Linux, but on Windows prior to this patch a different
error was produced: `Parse error: Invalid numeric literal in %s on line %d`.
2019-05-13 11:04:56 +02:00
Peter Kokot 43e6fd1e2b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Convert CRLF to LF
2019-05-13 03:53:31 +02:00
Peter Kokot f95b27c6f6 Convert CRLF to LF
These files are tracked with CRLF line endings in Git and can be
converted to LF. Neither are parts of tests or code itself.
2019-05-13 03:51:00 +02:00
Jakub Zelenka 0cad701374 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-11 20:08:57 +01:00
Jakub Zelenka cc5c51e7f0 Fix bug #77934 (php-fpm kill -USR2 not working) 2019-05-11 20:07:39 +01:00
Peter Kokot bec22af8d7 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Convert CRLF to LF in *.wsdl files
2019-05-11 17:15:08 +02:00
Peter Kokot b15bfb9129 Convert CRLF to LF in *.wsdl files
These EOL types are part of different environments and not part of the
tests themselves.
2019-05-11 17:12:28 +02:00
Christoph M. Becker 49b5ffe48c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix typo
2019-05-10 18:44:47 +02:00
Christoph M. Becker 3759c6316d Fix typo
Since opcache.enable defaults to 1 anyway, this change is only
cosmetic.
2019-05-10 18:43:40 +02:00
George Wang d2037b1bd4 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-09 18:14:11 -04:00
George Wang af4143753f Updated LiteSpeed SAPI to 7.3.2 to allow request header value length up to 64K. 2019-05-09 18:13:25 -04:00
Christoph M. Becker fd1ffa4692 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix erroneous assertions
2019-05-09 16:55:35 +02:00
Christoph M. Becker 27f168cf63 Fix erroneous assertions
Since PHP strings are binary safe (i.e. they may contain NUL bytes), we
must not assume that strlen()/wcslen() actually return the length of
the string.  Only if the given in_len is zero, it is safe to assert
this.
2019-05-09 16:54:11 +02:00
Nikita Popov 90318fbcbe Merge branch 'PHP-7.2' into PHP-7.3 2019-05-09 12:35:11 +02:00
Nikita Popov 35c80583f0 Fixed bug #75186 2019-05-09 12:33:53 +02:00
Christoph M. Becker e46b3c3e70 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix log_verbosity_bug.phpt
2019-05-09 12:15:32 +02:00
Christoph M. Becker e359812ce3 Fix log_verbosity_bug.phpt
This test may fail on Windows due to the file cache fallback.  We
ensure that this will not happen.
2019-05-09 12:15:00 +02:00
Christoph M. Becker 236522529c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add {TMP} placeholder for PHPT INI sections
2019-05-08 19:22:21 +02:00
Christoph M. Becker 3d0a0f801b Add {TMP} placeholder for PHPT INI sections
Several tests use `/tmp` in the `--INI--` section, but this is not
portable.  We therefore introduce the `{TMP}` placeholder which
evaluates to the system's temporary directory using
`sys_get_temp_dir()`.

We also remove the doubtful `strpos()` optimization.
2019-05-08 19:21:38 +02:00
Nikita Popov e2ef4e9e2f Merge branch 'PHP-7.2' into PHP-7.3 2019-05-08 11:37:49 +02:00
Nikita Popov d19b6aa5ba Fix resolution of "parent" during inheritance check
We can't assume that the method we're checking against is part of
the parent class...
2019-05-08 11:35:26 +02:00
Peter Kokot d153fbc5a9 Convert CRLF line endings to LF
This patch simplifies line endings tracked in the Git repository and
syncs them to all include the LF style instead of the CRLF files.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git additionally provides `.gitattributes` file to specify if some files
need to have specific line endings on all platforms (either CRLF or LF).

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion is core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2019-05-07 04:34:37 +02:00
Jakub Zelenka 36a7d9fca4 Merge branch 'PHP-7.2' into PHP-7.3 2019-05-05 21:05:55 +01:00
Jakub Zelenka 9977de0028 Fix OpenSSL online test for ca context
The php.net is redirected to https so use nginx.org
2019-05-05 21:04:28 +01:00
Javier Spagnoletti 78d24429f2 Update NEWS with changes made at #4093 2019-05-03 17:32:40 +02:00
Javier Spagnoletti 6b73e692c9 Add more missing CURL_VERSION_* constants
And also check for CURL_VERSION_* constants in the sync-constants.php
script.

Related to request #72189: Add missing `CURL_VERSION_*` constants.
2019-05-02 15:11:42 +02:00
Christoph M. Becker d91b643c87 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS wrt. sec fixes
2019-04-30 09:36:09 +02:00
Christoph M. Becker 1210c3b960 Update NEWS wrt. sec fixes 2019-04-30 09:34:53 +02:00
Stanislav Malyshev 66b32f25d5 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
2019-04-30 00:05:43 -07:00
Stanislav Malyshev cb5af4e8a0 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
2019-04-30 00:05:32 -07:00
Stanislav Malyshev f80ad18afa Fix bug #77950 - Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG
I do not completely understand what is going on there, but I am pretty
sure dir_entry <= offset_base if not a normal situation, so we better not
to rely on such dir_entry.
2019-04-30 00:05:23 -07:00
Stanislav Malyshev 506a764089 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:10 -07:00
Stanislav Malyshev 2c3933821f Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fix #77821: Potential heap corruption in TSendMail()
2019-04-29 22:09:04 -07:00
Christoph M. Becker 6c631ccfef Fix #77821: Potential heap corruption in TSendMail()
`zend_string_tolower()` returns a copy (not a duplicate) of the given
string, if it is already in lower case.  In this case we must not not
`zend_string_free()` both strings.  The cleanest solution is to call
` zend_string_release()` on both strings, which properly handles the
refcount.
2019-04-29 22:08:19 -07:00
Christoph M. Becker a30b919872 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77943: imageantialias($image, false); does not work
2019-04-29 17:23:45 +02:00
Christoph M. Becker 18a9ae412f Fix #77943: imageantialias($image, false); does not work
Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag.
Furthermore, we have to actually use the supplied boolean value.

We also make sure that we don't attempt to enable anti-aliasing for
palette images.
2019-04-29 17:23:16 +02:00
Christoph M. Becker 44494c09bc Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Add tests for bug77943
2019-04-29 16:29:29 +02:00
Christoph M. Becker 3891e0d13a Add tests for bug77943 2019-04-29 16:29:08 +02:00
Christoph M. Becker 3fc1bdc81c Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77943: imageantialias($image, false); does not work
2019-04-29 16:18:27 +02:00
Christoph M. Becker cd94cf60a2 Fix #77943: imageantialias($image, false); does not work
Firstly, we must not call `gdImageSetAntiAliased()` (which sets the
color to anti-alias), but rather modify the `gdImage.AA` flag.
Furthermore, we have to actually use the supplied boolean value.

We also make sure that we don't attempt to enable anti-aliasing for
palette images.
2019-04-29 16:16:46 +02:00
Nikita Popov ff2b5bda59 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-29 13:53:45 +02:00
Nikita Popov 5da0579259 Fixed bug #77945
Make sure that we proper distinguish between empty string key and
no key during SDL serialization.
2019-04-29 13:52:18 +02:00
Christoph M. Becker 7faaf5a89a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix tests
2019-04-29 09:05:04 +02:00
Christoph M. Becker 9bf11045db Fix tests
These tests are obviously meant to test successful and failing uri:
DSNs, but did not pass proper file:// URIs, so actually ended up
testing for invalid data source URIs twice.  We fix this, and adjust
the expectations accordingly.

We also unfork the -win32 variant, since both test cases are almost
identical, and the expected error message may be either one.
2019-04-29 09:04:33 +02:00
Christoph M. Becker 06b130579e Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Make MySQLPDOTest::extractVersion() more liberal
2019-04-28 23:49:19 +02:00
Christoph M. Becker fc9cdb723b Make MySQLPDOTest::extractVersion() more liberal
MySQL/MariaDB version strings may have suffixes which may contain dots;
for instance, Debian stretch has 5.5.5-10.1.37-MariaDB-0+deb9u1 or
such.  Therefore, we make the version extraction more liberal, and only
require that there are at least three parts separated by dot, and
ignore additional parts.

We also fix an erroneous test expectation, which would be triggered on
CI now, right away.  This patch has been provided by petk@.
2019-04-28 23:48:27 +02:00
Peter Kokot f83c207d60 Update NEWS 2019-04-28 00:51:18 +02:00
Peter Kokot 1bdd97a601 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update NEWS
  Fix #77024: SplFileObject::__toString() may return array
2019-04-28 00:50:54 +02:00
Peter Kokot 6d8892aacd Update NEWS 2019-04-28 00:50:40 +02:00
Craig Duncan 91c6fb881e Fix #77024: SplFileObject::__toString() may return array
- Correct the behaviour of casting spl files to strings
- Add a test for Bug 77024
2019-04-28 00:44:48 +02:00
Christoph M. Becker 3309f2fbb9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  PHP, meet MySQL
2019-04-27 19:22:10 +02:00
Christoph M. Becker 57d5dc5688 PHP, meet MySQL
All pdo_mysql tests are skipped on AppVeyor because "No such host is
known".  We change the DSN to use semicolons instead of spaces to fix
that.
2019-04-27 19:21:51 +02:00
Christoph M. Becker e561d4100b Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77944: Wrong meta pdo_type for bigint on LLP64
2019-04-27 18:47:32 +02:00
Christoph M. Becker 16609880f8 Fix #77944: Wrong meta pdo_type for bigint on LLP64
When actually fetching the data, bigint (unsigned) column values are
returned as integers on LLP64 architectures, so their pdo_type has to
be PDO::PARAM_INT accordingly.
2019-04-27 18:46:27 +02:00
Christoph M. Becker 70239ea1d3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 23:29:03 +02:00
Christoph M. Becker 7ddfe73e69 Fix #77940: test using outdated mon_thousands_sep for Swedish
Of course, we should expect a comma, not a period.
2019-04-25 23:28:41 +02:00
Christoph M. Becker 3e31ae5d70 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 19:40:05 +02:00
Christoph M. Becker bfbfb9dabd Fix #77940: test using outdated mon_thousands_sep for Swedish
This time so that it works for all Windows 10 versions (hopefully).
2019-04-25 19:39:42 +02:00
Christoph M. Becker dcba479848 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77940: test using outdated mon_thousands_sep for Swedish
2019-04-25 08:59:09 +02:00
Christoph M. Becker 37ca6a7a2a Fix #77940: test using outdated mon_thousands_sep for Swedish 2019-04-25 08:58:13 +02:00
Christoph M. Becker ad0acc0aa9 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77938: socket_get_option error
2019-04-25 00:04:37 +02:00
Christoph M. Becker fe202d99c8 Fix #77938: socket_get_option error
Since tcp_socket/ssl streams are not representable, we suppress the
redirect to fix the test case.
2019-04-25 00:03:45 +02:00
Remi Collet 191e15309f Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  news entry for litespeed
2019-04-24 09:46:06 +02:00
Remi Collet 5d21a15cc3 news entry for litespeed 2019-04-24 09:45:48 +02:00
Nikita Popov 68892410f7 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-23 12:43:32 +02:00
Nikita Popov 4831e150c5 Fixed bug #77843 2019-04-23 12:43:07 +02:00
Nikita Popov cedee4408b Fixed bug #77931 2019-04-23 11:40:13 +02:00
George Wang fb4c811835 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-21 15:59:07 -04:00
George Wang ce73841cdc Improved LSAPI_End_Response_r() . 2019-04-21 15:04:54 -04:00
George Wang ccf051c317 Fixed bug in litespeed_finish_request(), disable fastcgi_finish_request() alias for now. 2019-04-21 14:59:51 -04:00
Peter Kokot 0b8414832e Update changelog 2019-04-20 19:13:06 +02:00
Peter Kokot 2549f7d220 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update changelog
  Fix #77921: static.php.net doesn't work anymore
2019-04-20 19:12:31 +02:00
Peter Kokot 295c66911f Update changelog 2019-04-20 19:12:17 +02:00
Peter Kokot 4450288344 Fix #77921: static.php.net doesn't work anymore
This embeds the PHP logo image in the FPM status HTML page instead of
using remote location. The phpinfo() output also uses such approach
and browser compatibility looks decent [1].

1: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
2019-04-20 19:00:51 +02:00
Peter Kokot d1bce98597 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Update Git repository for Windows build tool kit
2019-04-19 21:11:01 +02:00
Peter Kokot 06fa35568e Update Git repository for Windows build tool kit 2019-04-19 21:09:46 +02:00
Christoph M. Becker fd4c42efab Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Use php-sdk-2.2.0beta5 on AppVeyor
2019-04-18 16:51:38 +02:00
Christoph M. Becker a7ada30ac6 Use php-sdk-2.2.0beta5 on AppVeyor 2019-04-18 16:51:10 +02:00
Dmitry Stogov 3a04adce82 Check assert only when RC_DEBUG is enabled 2019-04-18 14:26:15 +03:00
Nikita Popov b2f49c69b1 Add a dl() test to Travis
Compile the zend_test extension as shared and try loading it with dl()
to test for obvious issues. Doing this as a standalone call because this
is very specific to the CI setup.
2019-04-18 12:57:54 +02:00
Nikita Popov e9aa0337ab Fix more dl() interned string assertions 2019-04-18 12:14:07 +02:00
Dmitry Stogov bfadd9fdaf It's safe to keep old string if it's stored not in SHM. 2019-04-17 21:57:17 +03:00
Dmitry Stogov ac12cc85aa Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning. 2019-04-17 19:31:28 +03:00
Christoph M. Becker f0ccd9ffc6 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77911: Wrong warning for session.sid_bits_per_character
2019-04-17 17:24:15 +02:00
Christoph M. Becker d20053a556 Fix #77911: Wrong warning for session.sid_bits_per_character 2019-04-17 17:23:23 +02:00
Derick Rethans 6088713216 Merge branch 'PHP-7.2' into PHP-7.3 2019-04-17 09:40:18 +01:00
Ignace Nyamagana Butera 7b1a4e2400 Fixed bug #77909: DatePeriod::__construct() with invalid recurrence count value
Improve error message on invalid reccurence count

Adding test when reccurence is -1
2019-04-17 09:39:03 +01:00
Christoph M. Becker ec8457d982 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix tests for non English environments
2019-04-17 09:57:37 +02:00
Christoph M. Becker 6fe75f9e45 Fix tests for non English environments 2019-04-17 09:56:55 +02:00
Remi Collet e90bce7f08 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  next is 7.2.19
2019-04-16 13:12:33 +02:00
Remi Collet 6c44a71e4a next is 7.2.19 2019-04-16 13:11:23 +02:00
Nikita Popov f9a755d0d2 Fix HT flags copying wrt iterator count
HT_FLAGS() includes the full flag word, including the iterator
count. When we're fully reassigning it, we need to make sure that
we either really do want to copy the iterator count (as in some
cases in array.c) or we need to mask only the actual flag byte.

Add an assert to hash_iterators_del() to make sure the iterator
count is non-zero (which is how I ran into this) and make sure that
the iterator count is correctly preserved during array splicing.
2019-04-16 12:14:45 +02:00
Christoph M. Becker 5ae49c43dc Prepare main branch for PHP 7.3.6 2019-04-16 11:56:03 +02:00
175 changed files with 9673 additions and 7757 deletions

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ environment:
PHP_BUILD_CACHE_BASE_DIR: c:\build-cache
PHP_BUILD_OBJ_DIR: c:\obj
PHP_BUILD_CACHE_SDK_DIR: c:\build-cache\sdk
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta4
PHP_BUILD_SDK_BRANCH: php-sdk-2.2.0beta6
PHP_BUILD_CRT: vc15
# ext and env setup for tests
#MYSQL_TEST_PASSWD: Password12!
+10 -23
View File
@@ -3,45 +3,32 @@
root = true
[*]
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
charset = utf-8
tab_width = 4
[*.{c,h,y,awk,w32,bat,mk,frag,cpp}]
charset = utf-8
end_of_line = lf
[{*.{awk,bat,c,cpp,d,h,l,mk,re,skl,w32,y},Makefile*}]
indent_size = 4
indent_style = tab
trim_trailing_whitespace = true
insert_final_newline = true
[*.{php,phpt,inc}]
charset = utf-8
end_of_line = lf
[*.{dtd,html,inc,php,phpt,rng,wsdl,xml,xsd,xsl}]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.{yml,m4,sh}]
charset = utf-8
end_of_line = lf
[*.{ac,m4,sh,yml}]
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 = true
insert_final_newline = true
max_line_length = 80
[COMMIT_EDITMSG]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80
[*.patch]
trim_trailing_whitespace = false
+2 -1
View File
@@ -67,7 +67,8 @@ before_script:
# Run PHPs run-tests.php
script:
- ./sapi/cli/php run-tests.php -p `pwd`/sapi/cli/php $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120
- ./sapi/cli/php run-tests.php -P -d extension=`pwd`/modules/zend_test.so $(if [ $ENABLE_DEBUG == 0 ]; then echo "-d opcache.enable_cli=1 -d zend_extension=`pwd`/modules/opcache.so"; fi) -g "FAIL,XFAIL,BORK,WARN,LEAK,SKIP" --offline --show-diff --show-slow 1000 --set-timeout 120
- sapi/cli/php -d extension_dir=`pwd`/modules -r 'dl("zend_test");'
after_success:
- ccache --show-stats
+113 -3
View File
@@ -1,6 +1,107 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.3.5
13 Jun 2019, PHP 7.3.7RC1
- Core:
. Fixed bug #76980 (Interface gets skipped if autoloader throws an exception).
(Nikita)
- DOM:
. Fixed bug #78025 (segfault when accessing properties of DOMDocumentType).
(cmb)
- MySQLi:
. Fixed bug #77956 (When mysqli.allow_local_infile = Off, use a meaningful
error message). (Sjon Hortensius)
. Fixed bug #38546 (bindParam incorrect processing of bool types).
(camporter)
- MySQLnd:
. Fixed bug #77955 (Random segmentation fault in mysqlnd from php-fpm).
(Nikita)
- Opcache:
. Fixed bug #78015 (Incorrect evaluation of expressions involving partials
arrays in SCCP). (Nikita)
- OpenSSL:
. Fixed bug #78079 (openssl_encrypt_ccm.phpt fails with OpenSSL 1.1.1c).
(Jakub Zelenka)
- phpdbg:
. Fixed bug #78050 (SegFault phpdbg + opcache on include file twice).
(Nikita)
- Sockets:
. Fixed bug #78038 (Socket_select fails when resource array contains
references). (Nikita)
- Sodium:
. Fixed bug #78114 (segfault when calling sodium_* functions from eval). (cmb)
- Standard:
. Fixed bug #77135 (Extract with EXTR_SKIP should skip $this).
(Craig Duncan, Dmitry)
. Fixed bug ##77937 (preg_match failed). (cmb, Anatol)
- Zip:
. Fixed bug #76345 (zip.h not found). (Michael Maroszek)
30 May 2019, PHP 7.3.6
- cURL:
. Implemented FR #72189 (Add missing CURL_VERSION_* constants). (Javier
Spagnoletti)
- EXIF:
. Fixed bug #77988 (heap-buffer-overflow on php_jpg_get16).
(CVE-2019-11040) (Stas)
- FPM:
. Fixed bug #77934 (php-fpm kill -USR2 not working). (Jakub Zelenka)
. Fixed bug #77921 (static.php.net doesn't work anymore). (Peter Kokot)
- GD:
. Fixed bug #77943 (imageantialias($image, false); does not work). (cmb)
. Fixed bug #77973 (Uninitialized read in gdImageCreateFromXbm).
(CVE-2019-11038) (cmb)
- Iconv:
. Fixed bug #78069 (Out-of-bounds read in iconv.c:_php_iconv_mime_decode()
due to integer overflow). (CVE-2019-11039). (maris dot adam)
- JSON:
. Fixed bug #77843 (Use after free with json serializer). (Nikita)
- Opcache:
. Fixed possible crashes, because of inconsistent PCRE cache and opcache
SHM reset. (Alexey Kalinin, Dmitry)
- PDO_MySQL:
. Fixed bug #77944 (Wrong meta pdo_type for bigint on LLP64). (cmb)
- Reflection:
. Fixed bug #75186 (Inconsistent reflection of Closure:::__invoke()). (Nikita)
- Session:
. Fixed bug #77911 (Wrong warning for session.sid_bits_per_character). (cmb)
- SOAP:
. Fixed bug #77945 (Segmentation fault when constructing SoapClient with
WSDL_CACHE_BOTH). (Nikita)
- SPL:
. Fixed bug #77024 (SplFileObject::__toString() may return array). (Craig
Duncan)
- SQLite:
. Fixed bug #77967 (Bypassing open_basedir restrictions via file uris). (Stas)
- Standard:
. Fixed bug #77931 (Warning for array_map mentions wrong type). (Nikita)
. Fixed bug #78003 (strip_tags output change since PHP 7.3). (cmb)
02 May 2019, PHP 7.3.5
- Core:
. Fixed bug #77903 (ArrayIterator stops iterating after offsetSet call).
@@ -10,6 +111,10 @@ PHP NEWS
. Fixed bug #77794 (Incorrect Date header format in built-in server).
(kelunik)
- EXIF
. Fixed bug #77950 (Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG).
(CVE-2019-11036) (Stas)
- Interbase:
. Fixed bug #72175 (Impossibility of creating multiple connections to
Interbase with php 7.x). (Nikita)
@@ -21,6 +126,9 @@ PHP NEWS
- LDAP:
. Fixed bug #77869 (Core dump when using server controls) (mcmic)
- Mail
. Fixed bug #77821 (Potential heap corruption in TSendMail()). (cmb)
- mbstring:
. Implemented FR #72777 (Implement regex stack limits for mbregex functions).
(Yasuo Ohgaki, Stas)
@@ -82,8 +190,10 @@ PHP NEWS
. Fixed bug #77578 (Crash when php unload). (cmb)
- EXIF:
. Fixed bug #77753 (Heap-buffer-overflow in php_ifd_get32s). (Stas)
. Fixed bug #77831 (Heap-buffer-overflow in exif_iif_add_value). (Stas)
. Fixed bug #77753 (Heap-buffer-overflow in php_ifd_get32s). (CVE-2019-11034)
(Stas)
. Fixed bug #77831 (Heap-buffer-overflow in exif_iif_add_value).
(CVE-2019-11035) (Stas)
- FPM:
. Fixed bug #77677 (FPM fails to build on AIX due to missing WCOREDUMP).
-6
View File
@@ -167,13 +167,7 @@ TSRM_API const char *tsrm_api_name(void);
#define TSRMG_BULK_STATIC(id, type) ((type) (*((void ***) TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(id)])
#define TSRMLS_CACHE_EXTERN() extern TSRM_TLS void *TSRMLS_CACHE;
#define TSRMLS_CACHE_DEFINE() TSRM_TLS void *TSRMLS_CACHE = NULL;
#if ZEND_DEBUG
#define TSRMLS_CACHE_UPDATE() TSRMLS_CACHE = tsrm_get_ls_cache()
#define TSRMLS_CACHE_RESET()
#else
#define TSRMLS_CACHE_UPDATE() if (!TSRMLS_CACHE) TSRMLS_CACHE = tsrm_get_ls_cache()
#define TSRMLS_CACHE_RESET() TSRMLS_CACHE = NULL
#endif
#define TSRMLS_CACHE _tsrm_ls_cache
/* BC only */
+5 -3
View File
@@ -622,9 +622,11 @@ Curl:
. CURL_SSLVERSION_MAX_TLSv1_2
. CURL_SSLVERSION_MAX_TLSv1_3
. CURL_SSLVERSION_TLSv1_3
. CURL_VERSION_ALTSVC
. CURL_VERSION_ASYNCHDNS
. CURL_VERSION_BROTLI
. CURL_VERSION_CONV
. CURL_VERSION_CURLDEBUG
. CURL_VERSION_DEBUG
. CURL_VERSION_GSSAPI
. CURL_VERSION_GSSNEGOTIATE
@@ -634,6 +636,7 @@ Curl:
. CURL_VERSION_MULTI_SSL
. CURL_VERSION_NTLM
. CURL_VERSION_NTLM_WB
. CURL_VERSION_PSL
. CURL_VERSION_SPNEGO
. CURL_VERSION_SSPI
. CURL_VERSION_TLSAUTH_SRP
@@ -728,8 +731,8 @@ LDAP:
is used only when error_log is set syslog.
- mbstring.regex_stack_limit
. New INI directive (since 7.3.6) limiting stack depth of mbstring/oniguruma
regular expressions.
. New INI directive (since 7.3.5) limiting stack depth of mbstring/oniguruma
regular expressions.
========================================
12. Windows Support
@@ -748,4 +751,3 @@ LDAP:
. The cyclic GC has been enhanced, which may result in considerable performance
improvements.
+8 -4
View File
@@ -13,18 +13,22 @@ spl_autoload_register(function ($className) {
}
});
new Foo;
try {
new Foo();
} catch (Exception $e) { }
// We never reach here.
var_dump(new Foo());
?>
--EXPECTF--
string(3) "Foo"
string(3) "Bar"
Fatal error: Uncaught Exception: Bar in %s:%d
Fatal error: During class fetch: Uncaught Exception: Bar in %s:%d
Stack trace:
#0 [internal function]: {closure}('Bar')
#1 %s(%d): spl_autoload_call('Bar')
#2 [internal function]: {closure}('Foo')
#3 %s(%d): spl_autoload_call('Foo')
#4 {main}
thrown in %s on line %d
#4 {main} in %s on line %d
+1 -1
View File
@@ -46,7 +46,7 @@ elseif (PHP_OS == 'FreeBSD') {
die('skip Not enough memory.');
}
} elseif (PHP_OS == "WINNT") {
$s = trim(shell_exec("wmic OS get FreeVirtualMemory /Value 2>nil"));
$s = trim(shell_exec("wmic OS get FreeVirtualMemory /Value 2>nul"));
$freeMemory = explode('=', $s)[1]*1;
if ($freeMemory < 2.1*1024*1024) {
+7
View File
@@ -0,0 +1,7 @@
--TEST--
Bug #77993 (Wrong parse error for invalid hex literal on Windows)
--FILE--
<?php
0xg10;
--EXPECTF--
Parse error: syntax error, unexpected 'xg10' (T_STRING) in %s on line %d
@@ -0,0 +1,17 @@
--TEST--
The parent class is not necessarily the class of the prototype
--FILE--
<?php
class A {
function test(): B {}
}
class B extends A {}
class C extends B {
function test(): parent {}
}
?>
===DONE===
--EXPECT--
===DONE===
+1 -1
View File
@@ -20,7 +20,7 @@
#ifndef ZEND_H
#define ZEND_H
#define ZEND_VERSION "3.3.5-dev"
#define ZEND_VERSION "3.3.7RC1"
#define ZEND_ENGINE_3
+23 -13
View File
@@ -2051,13 +2051,13 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
}
name_len = strlen(module->name);
lcname = zend_string_alloc(name_len, 1);
lcname = zend_string_alloc(name_len, module->type == MODULE_PERSISTENT);
zend_str_tolower_copy(ZSTR_VAL(lcname), module->name, name_len);
lcname = zend_new_interned_string(lcname);
if ((module_ptr = zend_hash_add_mem(&module_registry, lcname, module, sizeof(zend_module_entry))) == NULL) {
zend_error(E_CORE_WARNING, "Module '%s' already loaded", module->name);
zend_string_release_ex(lcname, 1);
zend_string_release(lcname);
return NULL;
}
module = module_ptr;
@@ -2065,14 +2065,14 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module) /
if (module->functions && zend_register_functions(NULL, module->functions, NULL, module->type)==FAILURE) {
zend_hash_del(&module_registry, lcname);
zend_string_release_ex(lcname, 1);
zend_string_release(lcname);
EG(current_module) = NULL;
zend_error(E_CORE_WARNING,"%s: Unable to register functions, unable to load", module->name);
return NULL;
}
EG(current_module) = NULL;
zend_string_release_ex(lcname, 1);
zend_string_release(lcname);
return module;
}
/* }}} */
@@ -2279,14 +2279,14 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
return FAILURE;
}
}
lowercase_name = zend_string_tolower_ex(internal_function->function_name, 1);
lowercase_name = zend_string_tolower_ex(internal_function->function_name, type == MODULE_PERSISTENT);
lowercase_name = zend_new_interned_string(lowercase_name);
reg_function = malloc(sizeof(zend_internal_function));
memcpy(reg_function, &function, sizeof(zend_internal_function));
if (zend_hash_add_ptr(target_function_table, lowercase_name, reg_function) == NULL) {
unload=1;
free(reg_function);
zend_string_release_ex(lowercase_name, 1);
zend_string_release(lowercase_name);
break;
}
@@ -2378,7 +2378,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
}
ptr++;
count++;
zend_string_release_ex(lowercase_name, 1);
zend_string_release(lowercase_name);
}
if (unload) { /* before unloading, display all remaining bad function in the module */
if (scope) {
@@ -2724,10 +2724,10 @@ static zend_class_entry *do_register_internal_class(zend_class_entry *orig_class
class_entry->info.internal.module = EG(current_module);
if (class_entry->info.internal.builtin_functions) {
zend_register_functions(class_entry, class_entry->info.internal.builtin_functions, &class_entry->function_table, MODULE_PERSISTENT);
zend_register_functions(class_entry, class_entry->info.internal.builtin_functions, &class_entry->function_table, EG(current_module)->type);
}
lowercase_name = zend_string_tolower_ex(orig_class_entry->name, 1);
lowercase_name = zend_string_tolower_ex(orig_class_entry->name, EG(current_module)->type == MODULE_PERSISTENT);
lowercase_name = zend_new_interned_string(lowercase_name);
zend_hash_update_ptr(CG(class_table), lowercase_name, class_entry);
zend_string_release_ex(lowercase_name, 1);
@@ -2786,6 +2786,11 @@ ZEND_API int zend_register_class_alias_ex(const char *name, size_t name_len, zen
{
zend_string *lcname;
/* TODO: Move this out of here in 7.4. */
if (persistent && EG(current_module) && EG(current_module)->type == MODULE_TEMPORARY) {
persistent = 0;
}
if (name[0] == '\\') {
lcname = zend_string_alloc(name_len-1, persistent);
zend_str_tolower_copy(ZSTR_VAL(lcname), name+1, name_len-1);
@@ -2843,7 +2848,7 @@ ZEND_API int zend_disable_function(char *function_name, size_t function_name_len
{
zend_internal_function *func;
if ((func = zend_hash_str_find_ptr(CG(function_table), function_name, function_name_length))) {
func->fn_flags &= ~(ZEND_ACC_VARIADIC | ZEND_ACC_HAS_TYPE_HINTS);
func->fn_flags &= ~(ZEND_ACC_VARIADIC | ZEND_ACC_HAS_TYPE_HINTS | ZEND_ACC_HAS_RETURN_TYPE);
func->num_args = 0;
func->arg_info = NULL;
func->handler = ZEND_FN(display_disabled_function);
@@ -3696,6 +3701,11 @@ static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
return Z_STR_P(zv);
}
static zend_always_inline zend_bool is_persistent_class(zend_class_entry *ce) {
return (ce->type & ZEND_INTERNAL_CLASS)
&& ce->info.internal.module->type == MODULE_PERSISTENT;
}
ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, zval *property, int access_type, zend_string *doc_comment) /* {{{ */
{
zend_property_info *property_info, *property_info_ptr;
@@ -3761,10 +3771,10 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
if (access_type & ZEND_ACC_PUBLIC) {
property_info->name = zend_string_copy(name);
} else if (access_type & ZEND_ACC_PRIVATE) {
property_info->name = zend_mangle_property_name(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), ZSTR_VAL(name), ZSTR_LEN(name), ce->type & ZEND_INTERNAL_CLASS);
property_info->name = zend_mangle_property_name(ZSTR_VAL(ce->name), ZSTR_LEN(ce->name), ZSTR_VAL(name), ZSTR_LEN(name), is_persistent_class(ce));
} else {
ZEND_ASSERT(access_type & ZEND_ACC_PROTECTED);
property_info->name = zend_mangle_property_name("*", 1, ZSTR_VAL(name), ZSTR_LEN(name), ce->type & ZEND_INTERNAL_CLASS);
property_info->name = zend_mangle_property_name("*", 1, ZSTR_VAL(name), ZSTR_LEN(name), is_persistent_class(ce));
}
property_info->name = zend_new_interned_string(property_info->name);
@@ -3779,7 +3789,7 @@ ZEND_API int zend_declare_property_ex(zend_class_entry *ce, zend_string *name, z
ZEND_API int zend_declare_property(zend_class_entry *ce, const char *name, size_t name_length, zval *property, int access_type) /* {{{ */
{
zend_string *key = zend_string_init(name, name_length, ce->type & ZEND_INTERNAL_CLASS);
zend_string *key = zend_string_init(name, name_length, is_persistent_class(ce));
int ret = zend_declare_property_ex(ce, key, property, access_type, NULL);
zend_string_release(key);
return ret;
+11
View File
@@ -110,6 +110,17 @@ static zend_always_inline void zend_arena_release(zend_arena **arena_ptr, void *
arena->ptr = (char*)checkpoint;
}
static zend_always_inline zend_bool zend_arena_contains(zend_arena *arena, void *ptr)
{
while (arena) {
if ((char*)ptr > (char*)arena && (char*)ptr <= arena->ptr) {
return 1;
}
arena = arena->prev;
}
return 0;
}
#endif /* _ZEND_ARENA_H_ */
/*
+21 -7
View File
@@ -1359,14 +1359,28 @@ zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *
if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) {
return zend_lookup_class_ex(class_name, key, 0);
} else if ((ce = zend_lookup_class_ex(class_name, key, 1)) == NULL) {
if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && !EG(exception)) {
if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) {
zend_throw_or_error(fetch_type, NULL, "Interface '%s' not found", ZSTR_VAL(class_name));
} else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) {
zend_throw_or_error(fetch_type, NULL, "Trait '%s' not found", ZSTR_VAL(class_name));
} else {
zend_throw_or_error(fetch_type, NULL, "Class '%s' not found", ZSTR_VAL(class_name));
if (fetch_type & ZEND_FETCH_CLASS_SILENT) {
return NULL;
}
if (EG(exception)) {
if (!(fetch_type & ZEND_FETCH_CLASS_EXCEPTION)) {
zend_string *exception_str;
zval exception_zv;
ZVAL_OBJ(&exception_zv, EG(exception));
Z_ADDREF(exception_zv);
zend_clear_exception();
exception_str = zval_get_string(&exception_zv);
zend_error_noreturn(E_ERROR,
"During class fetch: Uncaught %s", ZSTR_VAL(exception_str));
}
return NULL;
}
if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) {
zend_throw_or_error(fetch_type, NULL, "Interface '%s' not found", ZSTR_VAL(class_name));
} else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) {
zend_throw_or_error(fetch_type, NULL, "Trait '%s' not found", ZSTR_VAL(class_name));
} else {
zend_throw_or_error(fetch_type, NULL, "Class '%s' not found", ZSTR_VAL(class_name));
}
return NULL;
}
+6 -4
View File
@@ -481,6 +481,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx)
if (EXPECTED(iter->ht) && EXPECTED(iter->ht != HT_POISONED_PTR)
&& EXPECTED(!HT_ITERATORS_OVERFLOW(iter->ht))) {
ZEND_ASSERT(HT_ITERATORS_COUNT(iter->ht) != 0);
HT_DEC_ITERATORS_COUNT(iter->ht);
}
iter->ht = NULL;
@@ -1928,7 +1929,8 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->pDestructor = ZVAL_PTR_DTOR;
if (source->nNumOfElements == 0) {
HT_FLAGS(target) = (HT_FLAGS(source) & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED)) | HASH_FLAG_STATIC_KEYS;
uint32_t mask = HASH_FLAG_MASK & ~(HASH_FLAG_INITIALIZED|HASH_FLAG_PACKED);
HT_FLAGS(target) = (HT_FLAGS(source) & mask) | HASH_FLAG_STATIC_KEYS;
target->nTableMask = HT_MIN_MASK;
target->nNumUsed = 0;
target->nNumOfElements = 0;
@@ -1936,7 +1938,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nInternalPointer = 0;
HT_SET_DATA_ADDR(target, &uninitialized_bucket);
} else if (GC_FLAGS(source) & IS_ARRAY_IMMUTABLE) {
HT_FLAGS(target) = HT_FLAGS(source);
HT_FLAGS(target) = HT_FLAGS(source) & HASH_FLAG_MASK;
target->nTableMask = source->nTableMask;
target->nNumUsed = source->nNumUsed;
target->nNumOfElements = source->nNumOfElements;
@@ -1945,7 +1947,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
target->nInternalPointer = source->nInternalPointer;
memcpy(HT_GET_DATA_ADDR(target), HT_GET_DATA_ADDR(source), HT_USED_SIZE(source));
} else if (HT_FLAGS(source) & HASH_FLAG_PACKED) {
HT_FLAGS(target) = HT_FLAGS(source);
HT_FLAGS(target) = HT_FLAGS(source) & HASH_FLAG_MASK;
target->nTableMask = HT_MIN_MASK;
target->nNumUsed = source->nNumUsed;
target->nNumOfElements = source->nNumOfElements;
@@ -1963,7 +1965,7 @@ ZEND_API HashTable* ZEND_FASTCALL zend_array_dup(HashTable *source)
zend_array_dup_packed_elements(source, target, 1);
}
} else {
HT_FLAGS(target) = HT_FLAGS(source);
HT_FLAGS(target) = HT_FLAGS(source) & HASH_FLAG_MASK;
target->nTableMask = source->nTableMask;
target->nNextFreeElement = source->nNextFreeElement;
target->nInternalPointer =
+3
View File
@@ -40,6 +40,9 @@
#define HASH_FLAG_HAS_EMPTY_IND (1<<5)
#define HASH_FLAG_ALLOW_COW_VIOLATION (1<<6)
/* Only the low byte are real flags */
#define HASH_FLAG_MASK 0xff
#define HT_FLAGS(ht) (ht)->u.flags
#define HT_IS_PACKED(ht) \
+2 -2
View File
@@ -208,8 +208,8 @@ static int zend_do_perform_type_hint_check(const zend_function *fe, zend_arg_inf
fe_class_name = ZEND_TYPE_NAME(fe_arg_info->type);
class_name = ZSTR_VAL(fe_class_name);
class_name_len = ZSTR_LEN(fe_class_name);
if (class_name_len == sizeof("parent")-1 && !strcasecmp(class_name, "parent") && proto->common.scope) {
fe_class_name = zend_string_copy(proto->common.scope->name);
if (class_name_len == sizeof("parent")-1 && !strcasecmp(class_name, "parent") && fe->common.scope && fe->common.scope->parent) {
fe_class_name = zend_string_copy(fe->common.scope->parent->name);
} else if (class_name_len == sizeof("self")-1 && !strcasecmp(class_name, "self") && fe->common.scope) {
fe_class_name = zend_string_copy(fe->common.scope->name);
} else {
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -1781,7 +1781,8 @@ NEWLINE ("\r"|"\n"|"\r\n")
char *end;
if (yyleng < MAX_LENGTH_OF_LONG - 1) { /* Won't overflow */
errno = 0;
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, &end, 0));
/* base must be passed explicitly for correct parse error on Windows */
ZVAL_LONG(zendlval, ZEND_STRTOL(yytext, &end, yytext[0] == '0' ? 8 : 10));
/* This isn't an assert, we need to ensure 019 isn't valid octal
* Because the lexing itself doesn't do that for us
*/
+15 -1
View File
@@ -234,7 +234,13 @@ static zend_string* ZEND_FASTCALL zend_new_interned_string_request(zend_string *
}
/* Create a short living interned, freed after the request. */
ZEND_ASSERT(!(GC_FLAGS(str) & GC_PERSISTENT));
#if ZEND_RC_DEBUG
if (zend_rc_debug) {
/* PHP shouldn't create persistent interned string during request,
* but at least dl() may do this */
ZEND_ASSERT(!(GC_FLAGS(str) & GC_PERSISTENT));
}
#endif
if (GC_REFCOUNT(str) > 1) {
zend_ulong h = ZSTR_H(str);
zend_string_delref(str);
@@ -257,6 +263,7 @@ static zend_string* ZEND_FASTCALL zend_string_init_interned_permanent(const char
return ret;
}
ZEND_ASSERT(permanent);
ret = zend_string_init(str, size, permanent);
ZSTR_H(ret) = h;
return zend_add_interned_string(ret, &interned_strings_permanent, IS_STR_PERMANENT);
@@ -278,6 +285,13 @@ static zend_string* ZEND_FASTCALL zend_string_init_interned_request(const char *
return ret;
}
#if ZEND_RC_DEBUG
if (zend_rc_debug) {
/* PHP shouldn't create persistent interned string during request,
* but at least dl() may do this */
ZEND_ASSERT(!permanent);
}
#endif
ret = zend_string_init(str, size, permanent);
ZSTR_H(ret) = h;
+1 -1
View File
@@ -1,6 +1,6 @@
@echo off
set SDK_REMOTE=https://github.com/OSTC/php-sdk-binary-tools.git
set SDK_REMOTE=https://github.com/Microsoft/php-sdk-binary-tools.git
set SDK_BRANCH=%PHP_BUILD_SDK_BRANCH%
set SDK_RUNNER=%PHP_BUILD_CACHE_SDK_DIR%\phpsdk-%PHP_BUILD_CRT%-%PLATFORM%.bat
+1 -1
View File
@@ -32,7 +32,7 @@ if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
set BRANCH=master
)
set STABILITY=staging
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH%
rem SDK is cached, deps info is cached as well
echo Updating dependencies in %DEPS_DIR%
cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR% --crt %PHP_BUILD_CRT%
+3 -3
View File
@@ -11,7 +11,7 @@ if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
set BRANCH=master
set STABILITY=staging
)
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VS%-%PHP_SDK_ARCH%
if not exist "%DEPS_DIR%" (
echo "%DEPS_DIR%" doesn't exist
exit /b 3
@@ -27,7 +27,7 @@ set PDO_MYSQL_TEST_USER=%MYSQL_TEST_USER%
set PDO_MYSQL_TEST_PASS=%MYSQL_PWD%
set PDO_MYSQL_TEST_HOST=%MYSQL_TEST_HOST%
set PDO_MYSQL_TEST_PORT=%MYSQL_TEST_PORT%
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST% port=%PDO_MYSQL_TEST_PORT% dbname=test user=%PDO_MYSQL_TEST_USER% password=%MYSQL_PW%
set PDO_MYSQL_TEST_DSN=mysql:host=%PDO_MYSQL_TEST_HOST%;port=%PDO_MYSQL_TEST_PORT%;dbname=test;user=%PDO_MYSQL_TEST_USER%;password=%MYSQL_PW%
"C:\Program Files\MySql\MySQL Server 5.7\bin\mysql.exe" --user=%MYSQL_TEST_USER% -e "CREATE DATABASE IF NOT EXISTS test"
if %errorlevel% neq 0 exit /b 3
@@ -58,7 +58,7 @@ rem set OPENSSL_CONF=
rem set SSLEAY_CONF=
rem prepare for Opcache
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enabled=1 -d opcache.enable_cli=1
if "%OPCACHE%" equ "1" set OPCACHE_OPTS=-d opcache.enable=1 -d opcache.enable_cli=1
rem prepare for enchant
mkdir c:\enchant_plugins
+2 -2
View File
@@ -107,8 +107,8 @@ int zend_sprintf(char *buffer, const char *format, ...);
PHP_MAJOR_VERSION=7
PHP_MINOR_VERSION=3
PHP_RELEASE_VERSION=5
PHP_EXTRA_VERSION="-dev"
PHP_RELEASE_VERSION=7
PHP_EXTRA_VERSION="RC1"
PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION"
PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 10000 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION`
+6
View File
@@ -1130,6 +1130,7 @@ PHP_MINIT_FUNCTION(curl)
#endif
#if LIBCURL_VERSION_NUM >= 0x071306 /* Available since 7.19.6 */
REGISTER_CURL_CONSTANT(CURL_VERSION_CURLDEBUG);
REGISTER_CURL_CONSTANT(CURLOPT_SSH_KNOWNHOSTS);
#endif
@@ -1334,6 +1335,7 @@ PHP_MINIT_FUNCTION(curl)
#if LIBCURL_VERSION_NUM >= 0x072f00 /* Available since 7.47.0 */
REGISTER_CURL_CONSTANT(CURL_HTTP_VERSION_2TLS);
REGISTER_CURL_CONSTANT(CURL_VERSION_PSL);
#endif
#if LIBCURL_VERSION_NUM >= 0x073000 /* Available since 7.48.0 */
@@ -1452,6 +1454,10 @@ PHP_MINIT_FUNCTION(curl)
REGISTER_CURL_CONSTANT(CURLOPT_TLS13_CIPHERS);
#endif
#if LIBCURL_VERSION_NUM >= 0x074001 /* Available since 7.64.1 */
REGISTER_CURL_CONSTANT(CURL_VERSION_ALTSVC);
#endif
REGISTER_CURL_CONSTANT(CURLOPT_SAFE_UPLOAD);
#ifdef PHP_CURL_NEED_OPENSSL_TSL
+1 -1
View File
@@ -228,7 +228,7 @@ PHP_FUNCTION(curl_multi_select)
}
#if LIBCURL_VERSION_NUM >= 0x071c00 /* Available since 7.28.0 */
error = curl_multi_wait(mh->multi, NULL, 0, (unsigned long) timeout * 1000.0, &numfds);
error = curl_multi_wait(mh->multi, NULL, 0, (unsigned long) (timeout * 1000.0), &numfds);
if (CURLM_OK != error) {
SAVE_CURLM_ERROR(mh, error);
RETURN_LONG(-1);
+6 -9
View File
@@ -17,6 +17,8 @@ const IGNORED_CONSTANTS = [
'CURLOPT_PROGRESSDATA'
];
const CONSTANTS_REGEX_PATTERN = '~^CURL(?:OPT|_VERSION)_[A-Z0-9_]+$~';
$curlConstants = getCurlConstants();
$sourceConstants = getSourceConstants();
@@ -157,13 +159,8 @@ function getCurlConstants() : array
$deprecated = $match[3] ?? null;
$removed = $match[4] ?? null;
if (strpos($name, 'CURLOPT_') !== 0) {
// not a CURLOPT_* constant
continue;
}
if (in_array($name, IGNORED_CONSTANTS)) {
// purposefully ignored constant
if (in_array($name, IGNORED_CONSTANTS, true) || !preg_match(CONSTANTS_REGEX_PATTERN, $name)) {
// not a wanted constant
continue;
}
@@ -197,8 +194,8 @@ function getSourceConstants() : array
continue;
}
if (strpos($name, 'CURLOPT_') !== 0) {
// not a CURLOPT_* constant
if (!preg_match(CONSTANTS_REGEX_PATTERN, $name)) {
// not a wanted constant
continue;
}
+49
View File
@@ -0,0 +1,49 @@
--TEST--
Request #72189 (Add missing CURL_VERSION_* constants)
--SKIPIF--
<?php
include 'skipif.inc';
$version = curl_version();
if ($version['version_number'] < 0x071306) {
exit('skip: test works only with curl >= 7.19.6');
}
?>
--FILE--
<?php
$version = curl_version();
$bitfields = [
CURL_VERSION_ASYNCHDNS,
CURL_VERSION_CONV,
CURL_VERSION_CURLDEBUG,
CURL_VERSION_DEBUG,
CURL_VERSION_GSSNEGOTIATE,
CURL_VERSION_IDN,
CURL_VERSION_IPV6,
CURL_VERSION_KERBEROS4,
CURL_VERSION_LARGEFILE,
CURL_VERSION_LIBZ,
CURL_VERSION_NTLM,
CURL_VERSION_SPNEGO,
CURL_VERSION_SSL,
CURL_VERSION_SSPI,
];
$matchesCount = 0;
foreach ($bitfields as $feature) {
if ($version['features'] & $feature) {
++$matchesCount;
}
}
var_dump($matchesCount > 0);
?>
--EXPECT--
bool(true)
+1 -1
View File
@@ -43,7 +43,7 @@ TLS-SRP => No
HTTP2 => Yes
GSSAPI => No
KERBEROS5 => Yes
UNIX_SOCKETS => No
UNIX_SOCKETS => %r(Yes|No)%r
PSL => No
HTTPS_PROXY => Yes
MULTI_SSL => %s
+1 -1
View File
@@ -26,5 +26,5 @@ curl_close($ch);
?>
--EXPECTF--
string(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:|Could not resolve:)%r %s"
string(%d) "%r(Couldn't resolve proxy|Could not resolve proxy:|Could not resolve host:|Could not resolve:|Unsupported proxy syntax in)%r %s"
int(5)
+38 -3
View File
@@ -4639,6 +4639,10 @@ PHP_METHOD(DatePeriod, __construct)
dpobj->end = clone;
}
}
if (dpobj->end == NULL && recurrences < 1) {
php_error_docref(NULL, E_WARNING, "The recurrence count '%d' is invalid. Needs to be > 0", (int) recurrences);
}
/* options */
dpobj->include_start_date = !(options & PHP_DATE_PERIOD_EXCLUDE_START_DATE);
@@ -5303,12 +5307,35 @@ PHP_METHOD(DatePeriod, __wakeup)
}
/* }}} */
/* {{{ date_period_is_magic_property
* Common for date_period_read_property() and date_period_write_property() functions
*/
static int date_period_is_magic_property(zend_string *name)
{
if (zend_string_equals_literal(name, "recurrences")
|| zend_string_equals_literal(name, "include_start_date")
|| zend_string_equals_literal(name, "start")
|| zend_string_equals_literal(name, "current")
|| zend_string_equals_literal(name, "end")
|| zend_string_equals_literal(name, "interval")
) {
return 1;
}
return 0;
}
/* }}} */
/* {{{ date_period_read_property */
static zval *date_period_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv)
{
if (type != BP_VAR_IS && type != BP_VAR_R) {
zend_throw_error(NULL, "Retrieval of DatePeriod properties for modification is unsupported");
return &EG(uninitialized_zval);
zend_string *name = zval_get_string(member);
if (date_period_is_magic_property(name)) {
zend_throw_error(NULL, "Retrieval of DatePeriod->%s for modification is unsupported", ZSTR_VAL(name));
zend_string_release(name);
return &EG(uninitialized_zval);
}
zend_string_release(name);
}
Z_OBJPROP_P(object); /* build properties hash table */
@@ -5320,7 +5347,15 @@ static zval *date_period_read_property(zval *object, zval *member, int type, voi
/* {{{ date_period_write_property */
static void date_period_write_property(zval *object, zval *member, zval *value, void **cache_slot)
{
zend_throw_error(NULL, "Writing to DatePeriod properties is unsupported");
zend_string *name = zval_get_string(member);
if (date_period_is_magic_property(name)) {
zend_throw_error(NULL, "Writing to DatePeriod->%s is unsupported", ZSTR_VAL(name));
zend_string_release(name);
return;
}
zend_string_release(name);
std_object_handlers.write_property(object, member, value, cache_slot);
}
/* }}} */
@@ -0,0 +1,37 @@
--TEST--
DatePeriod: Test read only properties
--INI--
date.timezone=UTC
--FILE--
<?php
$start = new DateTime;
$interval = new DateInterval('P1D');
$end = new DateTime;
$period = new DatePeriod($start, $interval, $end);
echo "recurrences: ";
var_dump($period->recurrences);
echo "include_start_date: ";
var_dump($period->include_start_date);
echo "start: ";
var_dump($period->start == $start);
echo "current: ";
var_dump($period->current);
echo "end: ";
var_dump($period->end == $end);
echo "interval: ";
var_dump($period->interval->format("%R%d"));
?>
--EXPECT--
recurrences: int(1)
include_start_date: bool(true)
start: bool(true)
current: NULL
end: bool(true)
interval: string(2) "+1"
@@ -0,0 +1,46 @@
--TEST--
DatePeriod: Test cannot modify read only properties
--INI--
date.timezone=UTC
--FILE--
<?php
$period = new DatePeriod(new DateTime, new DateInterval('P1D'), new DateTime);
$properties = [
"recurrences",
"include_start_date",
"start",
"current",
"end",
"interval",
];
foreach ($properties as $property) {
try {
$period->$property = "new";
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
try {
$period->$property[] = "extra";
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
}
?>
--EXPECT--
Writing to DatePeriod->recurrences is unsupported
Retrieval of DatePeriod->recurrences for modification is unsupported
Writing to DatePeriod->include_start_date is unsupported
Retrieval of DatePeriod->include_start_date for modification is unsupported
Writing to DatePeriod->start is unsupported
Retrieval of DatePeriod->start for modification is unsupported
Writing to DatePeriod->current is unsupported
Retrieval of DatePeriod->current for modification is unsupported
Writing to DatePeriod->end is unsupported
Retrieval of DatePeriod->end for modification is unsupported
Writing to DatePeriod->interval is unsupported
Retrieval of DatePeriod->interval for modification is unsupported
@@ -0,0 +1,19 @@
--TEST--
DatePeriod: Test wrong recurrence parameter on __construct
--FILE--
<?php
try {
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), 0);
} catch (Exception $exception) {
echo $exception->getMessage(), "\n";
}
try {
new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'),-1);
} catch (Exception $exception) {
echo $exception->getMessage(), "\n";
}
?>
--EXPECTF--
DatePeriod::__construct(): The recurrence count '0' is invalid. Needs to be > 0
DatePeriod::__construct(): The recurrence count '-1' is invalid. Needs to be > 0
+44
View File
@@ -0,0 +1,44 @@
--TEST--
Test for bug #65672: Broken classes inherited from DatePeriod
--INI--
date.timezone=UTC
--FILE--
<?php
$interval = new DateInterval('P1D');
$period = new class(new DateTime, $interval, new DateTime) extends DatePeriod {
public $extra = "stuff";
};
var_dump($period->extra);
$period->extra = "modified";
var_dump($period->extra);
# Ensure we can modify properties (retrieve for write)
$period->extra = [];
$period->extra[] = "array";
var_dump($period->extra);
var_dump(isset($period->dynamic1));
$period->dynamic1 = "dynamic";
var_dump($period->dynamic1);
# Ensure we can modify properties (retrieve for write)
$period->dynamic2 = [];
$period->dynamic2[] = "array";
var_dump($period->dynamic2);
?>
--EXPECT--
string(5) "stuff"
string(8) "modified"
array(1) {
[0]=>
string(5) "array"
}
bool(false)
string(7) "dynamic"
array(1) {
[0]=>
string(5) "array"
}
+1 -1
View File
@@ -50,7 +50,7 @@ int dom_documenttype_name_read(dom_object *obj, zval *retval)
return FAILURE;
}
ZVAL_STRING(retval, (char *) (dtdptr->name));
ZVAL_STRING(retval, dtdptr->name ? (char *) (dtdptr->name) : "");
return SUCCESS;
}
+18
View File
@@ -0,0 +1,18 @@
--TEST--
Bug #78025 (segfault when accessing properties of DOMDocumentType)
--SKIPIF--
<?php
if (!extension_loaded('dom')) die('skip dom extension not available');
?>
--FILE--
<?php
$htm = "<!DOCTYPE><html></html>";
$dom = new DOMDocument;
$dom->loadHTML($htm);
var_dump($dom->doctype->name);
?>
===DONE===
--EXPECTF--
Warning: DOMDocument::loadHTML(): htmlParseDocTypeDecl : no DOCTYPE name ! in Entity, line: 1 in %s on line %d
string(0) ""
===DONE===
+3 -1
View File
@@ -3277,7 +3277,7 @@ static int exif_process_IFD_TAG(image_info_type *ImageInfo, char *dir_entry, cha
offset_base is ImageInfo->file.list[sn].data-dir_offset
dir_entry - offset_base is dir_offset+2+i*12
*/
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base)) {
if (byte_count > IFDlength || offset_val > IFDlength-byte_count || value_ptr < dir_entry || offset_val < (size_t)(dir_entry-offset_base) || dir_entry <= offset_base) {
/* It is important to check for IMAGE_FILETYPE_TIFF
* JPEG does not use absolute pointers instead its pointers are
* relative to the start of the TIFF header in APP1 section. */
@@ -3920,6 +3920,8 @@ static int exif_scan_thumbnail(image_info_type *ImageInfo)
if (c == 0xFF)
return FALSE;
marker = c;
if (pos>=ImageInfo->Thumbnail.size)
return FALSE;
length = php_jpg_get16(data+pos);
if (length > ImageInfo->Thumbnail.size || pos >= ImageInfo->Thumbnail.size - length) {
return FALSE;
+12
View File
@@ -0,0 +1,12 @@
--TEST--
Bug #77950 (Heap-buffer-overflow in _estrndup via exif_process_IFD_TAG)
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
exif_read_data(__DIR__."/bug77950.tiff");
?>
DONE
--EXPECTF--
%A
DONE
Binary file not shown.
Binary file not shown.
+11
View File
@@ -0,0 +1,11 @@
--TEST--
Bug #77988 (heap-buffer-overflow on php_jpg_get16)
--SKIPIF--
<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
--FILE--
<?php
exif_read_data(__DIR__."/bug77988.jpg", 'COMMENT', FALSE, TRUE);
?>
DONE
--EXPECTF--
DONE
+5 -1
View File
@@ -4623,7 +4623,11 @@ PHP_FUNCTION(imageantialias)
if ((im = (gdImagePtr)zend_fetch_resource(Z_RES_P(IM), "Image", le_gd)) == NULL) {
RETURN_FALSE;
}
gdImageSetAntiAliased(im, 0);
if (im->trueColor) {
im->AA = alias;
}
RETURN_TRUE;
}
/* }}} */
+5 -1
View File
@@ -136,7 +136,11 @@ gdImagePtr gdImageCreateFromXbm(FILE * fd)
}
h[3] = ch;
}
sscanf(h, "%x", &b);
if (sscanf(h, "%x", &b) != 1) {
gd_error("invalid XBM");
gdImageDestroy(im);
return 0;
}
for (bit = 1; bit <= max_bit; bit = bit << 1) {
gdImageSetPixel(im, x++, y, (b & bit) ? 1 : 0);
if (x == im->sx) {
+29
View File
@@ -0,0 +1,29 @@
--TEST--
Bug #77943 (imageantialias($image, false); does not work)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
require_once __DIR__ . '/func.inc';
$width = 400;
$height = 300;
$im = imagecreatetruecolor($width, $height);
$white = imagecolorallocate($im, 255, 255, 255);
$blue = imagecolorallocate($im, 0, 0, 255);
imageantialias($im, false);
imagefilledrectangle($im, 0, 0, $width-1, $height-1, $white);
imageline($im, 0, 0, $width, $height, $blue);
imagesetthickness($im, 3);
imageline($im, 10, 0, $width, $height-10, $blue);
test_image_equals_file(__DIR__ . '/bug77943.png', $im);
?>
===DONE===
--EXPECT--
The images are equal.
===DONE===
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

+26
View File
@@ -0,0 +1,26 @@
--TEST--
Bug #77973 (Uninitialized read in gdImageCreateFromXbm)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die("skip gd extension not available");
if (!function_exists('imagecreatefromxbm')) die("skip imagecreatefromxbm not available");
?>
--FILE--
<?php
$contents = hex2bin("23646566696e6520776964746820320a23646566696e652068656967687420320a737461746963206368617220626974735b5d203d7b0a7a7a787a7a");
$filepath = __DIR__ . '/bug77973.xbm';
file_put_contents($filepath, $contents);
$im = imagecreatefromxbm($filepath);
var_dump($im);
?>
===DONE===
--EXPECTF--
Warning: imagecreatefromxbm(): invalid XBM in %s on line %d
Warning: imagecreatefromxbm(): '%s' is not a valid XBM file in %s on line %d
bool(false)
===DONE===
--CLEAN--
<?php
unlink(__DIR__ . '/bug77973.xbm');
?>
+3 -1
View File
@@ -1663,7 +1663,9 @@ static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *st
* we can do at this point. */
if (*(p1 + 1) == '=') {
++p1;
--str_left;
if (str_left > 1) {
--str_left;
}
}
err = _php_iconv_appendl(pretval, encoded_word, (size_t)((p1 + 1) - encoded_word), cd_pl);
Binary file not shown.
+15
View File
@@ -0,0 +1,15 @@
--TEST--
Bug #78069 (Out-of-bounds read in iconv.c:_php_iconv_mime_decode() due to integer overflow)
--SKIPIF--
<?php
if (!extension_loaded('iconv')) die('skip ext/iconv required');
?>
--FILE--
<?php
$hdr = iconv_mime_decode_headers(file_get_contents(__DIR__ . "/bug78069.data"),2);
var_dump(count($hdr));
?>
DONE
--EXPECT--
int(1)
DONE
+7 -1
View File
@@ -1538,11 +1538,17 @@ PHP_FUNCTION(locale_lookup)
intl_error_reset( NULL );
if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bS", &arr, &loc_range, &loc_range_len,
#if U_ICU_VERSION_MAJOR_NUM > 63
# define BANG "!"
#else
# define BANG
#endif
if(zend_parse_parameters( ZEND_NUM_ARGS(), "as|bS" BANG, &arr, &loc_range, &loc_range_len,
&boolCanonical, &fallback_loc_str) == FAILURE) {
intl_error_set( NULL, U_ILLEGAL_ARGUMENT_ERROR, "locale_lookup: unable to parse input params", 0 );
RETURN_FALSE;
}
#undef BANG
if(loc_range_len == 0) {
if(fallback_loc_str) {
@@ -3,6 +3,7 @@ IntlBreakIterator::getLocale(): basic test
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '64.0') >= 0) die('skip for ICU < 64.0'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
@@ -0,0 +1,20 @@
--TEST--
IntlBreakIterator::getLocale(): basic test
--SKIPIF--
<?php if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '64.0') < 0) die('skip for ICU >= 64.0'); ?>
--FILE--
<?php
ini_set("intl.error_level", E_WARNING);
ini_set("intl.default_locale", "pt_PT");
$bi = IntlBreakIterator::createSentenceInstance('pt');
var_dump($bi->getLocale(0));
var_dump($bi->getLocale(1));
?>
==DONE==
--EXPECT--
string(0) ""
string(2) "pt"
==DONE==
@@ -99,9 +99,9 @@ disp_locale=fr : display_language=ukrainien
disp_locale=de : display_language=Ukrainisch
-----------------
locale='root'
disp_locale=en : display_language=Root
disp_locale=fr : display_language=racine
disp_locale=de : display_language=[rR]oot
disp_locale=en : display_language=(Root|Unknown language)
disp_locale=fr : display_language=(racine|langue indéterminée)
disp_locale=de : display_language=([rR]oot|Unbekannte Sprache)
-----------------
locale='uk@currency=EURO'
disp_locale=en : display_language=Ukrainian
@@ -3,6 +3,7 @@ locale_get_display_name() icu >= 53.1
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '53.1') < 0) die('skip for ICU >= 53.1'); ?>
<?php if (version_compare(INTL_ICU_VERSION, '64.0') >= 0) die('skip for ICU < 64.0'); ?>
--FILE--
<?php
@@ -0,0 +1,342 @@
--TEST--
locale_get_display_name() icu >= 64.0
--SKIPIF--
<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
<?php if (version_compare(INTL_ICU_VERSION, '64.0') < 0) die('skip for ICU >= 64.0'); ?>
--FILE--
<?php
/*
* Try getting the display_name for different locales
* with Procedural and Object methods.
*/
function ut_main()
{
$res_str='';
$disp_locales=array('en','fr','de');
$locales = array(
'sl_IT_nedis_KIRTI',
'sl_IT_nedis-a-kirti-x-xyz',
'sl_IT_rozaj',
'sl_IT_NEDIS_ROJAZ_1901',
'i-enochian',
'zh-hakka',
'zh-wuu',
'i-tay',
'sgn-BE-nl',
'sgn-CH-de',
'sl_IT_rozaj@currency=EUR',
'uk-ua_CALIFORNIA@currency=;currency=GRN',
'root',
'uk@currency=EURO',
'Hindi',
//Simple language subtag
'de',
'fr',
'ja',
'i-enochian', //(example of a grandfathered tag)
//Language subtag plus Script subtag:
'zh-Hant',
'zh-Hans',
'sr-Cyrl',
'sr-Latn',
//Language-Script-Region
'zh-Hans-CN',
'sr-Latn-CS',
//Language-Variant
'sl-rozaj',
'sl-nedis',
//Language-Region-Variant
'de-CH-1901',
'sl-IT-nedis',
//Language-Script-Region-Variant
'sl-Latn-IT-nedis',
//Language-Region:
'de-DE',
'en-US',
'es-419',
//Private use subtags:
'de-CH-x-phonebk',
'az-Arab-x-AZE-derbend',
//Extended language subtags
'zh-min',
'zh-min-nan-Hant-CN',
//Private use registry values
'x-whatever',
'qaa-Qaaa-QM-x-southern',
'sr-Latn-QM',
'sr-Qaaa-CS',
/*Tags that use extensions (examples ONLY: extensions MUST be defined
by revision or update to this document or by RFC): */
'en-US-u-islamCal',
'zh-CN-a-myExt-x-private',
'en-a-myExt-b-another',
//Some Invalid Tags:
'de-419-DE',
'a-DE',
'ar-a-aaa-b-bbb-a-ccc'
);
$res_str = '';
foreach( $locales as $locale )
{
$res_str .= "locale='$locale'\n";
foreach( $disp_locales as $disp_locale )
{
$scr = ut_loc_get_display_name( $locale ,$disp_locale );
$scr = str_replace(array('(', ')'), '#', $scr);
$res_str .= "disp_locale=$disp_locale : display_name=$scr";
$res_str .= "\n";
}
$res_str .= "-----------------\n";
}
return $res_str;
}
include_once( 'ut_common.inc' );
ut_run();
?>
--EXPECTREGEX--
locale='sl_IT_nedis_KIRTI'
disp_locale=en : display_name=Slovenian #Italy, NEDIS_KIRTI#
disp_locale=fr : display_name=slovène #Italie, NEDIS_KIRTI#
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_KIRTI#
-----------------
locale='sl_IT_nedis-a-kirti-x-xyz'
disp_locale=en : display_name=Slovenian #Italy, NEDIS_A_KIRTI_X_XYZ#
disp_locale=fr : display_name=slovène #Italie, NEDIS_A_KIRTI_X_XYZ#
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_A_KIRTI_X_XYZ#
-----------------
locale='sl_IT_rozaj'
disp_locale=en : display_name=Slovenian #Italy, Resian#
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia#
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch)#
-----------------
locale='sl_IT_NEDIS_ROJAZ_1901'
disp_locale=en : display_name=Slovenian #Italy, NEDIS_ROJAZ_1901#
disp_locale=fr : display_name=slovène #Italie, NEDIS_ROJAZ_1901#
disp_locale=de : display_name=Slowenisch #Italien, NEDIS_ROJAZ_1901#
-----------------
locale='i-enochian'
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian#
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
-----------------
locale='zh-hakka'
disp_locale=en : display_name=Chinese( #HAKKA#)?
disp_locale=fr : display_name=chinois( #HAKKA#)?
disp_locale=de : display_name=Chinesisch( #HAKKA#)?
-----------------
locale='zh-wuu'
disp_locale=en : display_name=Chinese #WUU#
disp_locale=fr : display_name=chinois #WUU#
disp_locale=de : display_name=Chinesisch #WUU#
-----------------
locale='i-tay'
disp_locale=en : display_name=i-tay
disp_locale=fr : display_name=i-tay
disp_locale=de : display_name=i-tay
-----------------
locale='sgn-BE-nl'
disp_locale=en : display_name=sgn #Belgium, NL#
disp_locale=fr : display_name=sgn #Belgique, NL#
disp_locale=de : display_name=sgn #Belgien, NL#
-----------------
locale='sgn-CH-de'
disp_locale=en : display_name=sgn #Switzerland, DE#
disp_locale=fr : display_name=sgn #Suisse, DE#
disp_locale=de : display_name=sgn #Schweiz, DE#
-----------------
locale='sl_IT_rozaj@currency=EUR'
disp_locale=en : display_name=Slovenian #Italy, Resian, [Cc]urrency=Euro#
disp_locale=fr : display_name=slovène #Italie, dialecte de Resia, [Dd]evise=euro#
disp_locale=de : display_name=Slowenisch #Italien, (ROZAJ|Resianisch), Währung=Euro#
-----------------
locale='uk-ua_CALIFORNIA@currency=;currency=GRN'
disp_locale=en : display_name=
disp_locale=fr : display_name=
disp_locale=de : display_name=
-----------------
locale='root'
disp_locale=en : display_name=Unknown language
disp_locale=fr : display_name=langue indéterminée
disp_locale=de : display_name=Unbekannte Sprache
-----------------
locale='uk@currency=EURO'
disp_locale=en : display_name=Ukrainian #[Cc]urrency=EURO#
disp_locale=fr : display_name=ukrainien #[Dd]evise=EURO#
disp_locale=de : display_name=Ukrainisch #Währung=EURO#
-----------------
locale='Hindi'
disp_locale=en : display_name=hindi
disp_locale=fr : display_name=hindi
disp_locale=de : display_name=hindi
-----------------
locale='de'
disp_locale=en : display_name=German
disp_locale=fr : display_name=allemand
disp_locale=de : display_name=Deutsch
-----------------
locale='fr'
disp_locale=en : display_name=French
disp_locale=fr : display_name=français
disp_locale=de : display_name=Französisch
-----------------
locale='ja'
disp_locale=en : display_name=Japanese
disp_locale=fr : display_name=japonais
disp_locale=de : display_name=Japanisch
-----------------
locale='i-enochian'
disp_locale=en : display_name=i-enochian #Private-Use=i-enochian#
disp_locale=fr : display_name=i-enochian #Usage privé=i-enochian#
disp_locale=de : display_name=i-enochian #Privatnutzung=i-enochian#
-----------------
locale='zh-Hant'
disp_locale=en : display_name=Chinese #Traditional#
disp_locale=fr : display_name=chinois #traditionnel#
disp_locale=de : display_name=Chinesisch #Traditionell#
-----------------
locale='zh-Hans'
disp_locale=en : display_name=Chinese #Simplified#
disp_locale=fr : display_name=chinois #simplifié#
disp_locale=de : display_name=Chinesisch #Vereinfacht#
-----------------
locale='sr-Cyrl'
disp_locale=en : display_name=Serbian #Cyrillic#
disp_locale=fr : display_name=serbe #cyrillique#
disp_locale=de : display_name=Serbisch #Kyrillisch#
-----------------
locale='sr-Latn'
disp_locale=en : display_name=Serbian #Latin#
disp_locale=fr : display_name=serbe #latin#
disp_locale=de : display_name=Serbisch #Lateinisch#
-----------------
locale='zh-Hans-CN'
disp_locale=en : display_name=Chinese #Simplified, China#
disp_locale=fr : display_name=chinois #simplifié, Chine#
disp_locale=de : display_name=Chinesisch #Vereinfacht, China#
-----------------
locale='sr-Latn-CS'
disp_locale=en : display_name=Serbian #Latin, Serbia#
disp_locale=fr : display_name=serbe #latin, Serbie#
disp_locale=de : display_name=Serbisch #Lateinisch, Serbien#
-----------------
locale='sl-rozaj'
disp_locale=en : display_name=Slovenian #Resian#
disp_locale=fr : display_name=slovène #dialecte de Resia#
disp_locale=de : display_name=Slowenisch( #(ROZAJ|Resianisch)#)?
-----------------
locale='sl-nedis'
disp_locale=en : display_name=Slovenian #Natisone dialect#
disp_locale=fr : display_name=slovène #dialecte de Natisone#
disp_locale=de : display_name=Slowenisch #Natisone-Dialekt#
-----------------
locale='de-CH-1901'
disp_locale=en : display_name=German #Switzerland, Traditional German orthography#
disp_locale=fr : display_name=allemand #Suisse, orthographe allemande traditionnelle#
disp_locale=de : display_name=Deutsch #Schweiz, (1901|[aA]lte deutsche Rechtschreibung)#
-----------------
locale='sl-IT-nedis'
disp_locale=en : display_name=Slovenian #Italy, Natisone dialect#
disp_locale=fr : display_name=slovène #Italie, dialecte de Natisone#
disp_locale=de : display_name=Slowenisch #Italien, (NEDIS|Natisone-Dialekt)#
-----------------
locale='sl-Latn-IT-nedis'
disp_locale=en : display_name=Slovenian #Latin, Italy, Natisone dialect#
disp_locale=fr : display_name=slovène #latin, Italie, dialecte de Natisone#
disp_locale=de : display_name=Slowenisch #Lateinisch, Italien, (NEDIS|Natisone-Dialekt)#
-----------------
locale='de-DE'
disp_locale=en : display_name=German #Germany#
disp_locale=fr : display_name=allemand #Allemagne#
disp_locale=de : display_name=Deutsch #Deutschland#
-----------------
locale='en-US'
disp_locale=en : display_name=English #United States#
disp_locale=fr : display_name=anglais #États-Unis#
disp_locale=de : display_name=Englisch #Vereinigte Staaten#
-----------------
locale='es-419'
disp_locale=en : display_name=Spanish #Latin America#
disp_locale=fr : display_name=espagnol #Amérique latine#
disp_locale=de : display_name=Spanisch #Lateinamerika#
-----------------
locale='de-CH-x-phonebk'
disp_locale=en : display_name=German #Switzerland, Private-Use=phonebk#
disp_locale=fr : display_name=allemand #Suisse, Usage privé=phonebk#
disp_locale=de : display_name=Deutsch #Schweiz, Privatnutzung=phonebk#
-----------------
locale='az-Arab-x-AZE-derbend'
disp_locale=en : display_name=Azerbaijani #Arabic, Private-Use=aze-derbend#
disp_locale=fr : display_name=azéri #arabe, Usage privé=aze-derbend#
disp_locale=de : display_name=Aserbaidschanisch #Arabisch, Privatnutzung=aze-derbend#
-----------------
locale='zh-min'
disp_locale=en : display_name=Chinese #MIN#
disp_locale=fr : display_name=chinois #MIN#
disp_locale=de : display_name=Chinesisch #MIN#
-----------------
locale='zh-min-nan-Hant-CN'
disp_locale=en : display_name=Chinese #MIN, NAN_HANT_CN#
disp_locale=fr : display_name=chinois #MIN, NAN_HANT_CN#
disp_locale=de : display_name=Chinesisch #MIN, NAN_HANT_CN#
-----------------
locale='x-whatever'
disp_locale=en : display_name=x-whatever #Private-Use=whatever#
disp_locale=fr : display_name=x-whatever #Usage privé=whatever#
disp_locale=de : display_name=x-whatever #Privatnutzung=whatever#
-----------------
locale='qaa-Qaaa-QM-x-southern'
disp_locale=en : display_name=qaa #Qaaa, QM, Private-Use=southern#
disp_locale=fr : display_name=qaa #Qaaa, QM, Usage privé=southern#
disp_locale=de : display_name=qaa #Qaaa, QM, Privatnutzung=southern#
-----------------
locale='sr-Latn-QM'
disp_locale=en : display_name=Serbian #Latin, QM#
disp_locale=fr : display_name=serbe #latin, QM#
disp_locale=de : display_name=Serbisch #Lateinisch, QM#
-----------------
locale='sr-Qaaa-CS'
disp_locale=en : display_name=Serbian #Qaaa, Serbia#
disp_locale=fr : display_name=serbe #Qaaa, Serbie#
disp_locale=de : display_name=Serbisch #Qaaa, Serbien#
-----------------
locale='en-US-u-islamCal'
disp_locale=en : display_name=English #United States, attribute=islamcal#
disp_locale=fr : display_name=anglais #États-Unis, attribute=islamcal#
disp_locale=de : display_name=Englisch #Vereinigte Staaten, attribute=islamcal#
-----------------
locale='zh-CN-a-myExt-x-private'
disp_locale=en : display_name=Chinese #China, a=myext, Private-Use=private#
disp_locale=fr : display_name=chinois #Chine, a=myext, Usage privé=private#
disp_locale=de : display_name=Chinesisch #China, a=myext, Privatnutzung=private#
-----------------
locale='en-a-myExt-b-another'
disp_locale=en : display_name=English #a=myext, b=another#
disp_locale=fr : display_name=anglais #a=myext, b=another#
disp_locale=de : display_name=Englisch #a=myext, b=another#
-----------------
locale='de-419-DE'
disp_locale=en : display_name=German #Latin America, DE#
disp_locale=fr : display_name=allemand #Amérique latine, DE#
disp_locale=de : display_name=Deutsch #Lateinamerika, DE#
-----------------
locale='a-DE'
disp_locale=en : display_name=a #Germany#
disp_locale=fr : display_name=a #Allemagne#
disp_locale=de : display_name=a #Deutschland#
-----------------
locale='ar-a-aaa-b-bbb-a-ccc'
disp_locale=en : display_name=Arabic #a=aaa, b=bbb#
disp_locale=fr : display_name=arabe #a=aaa, b=bbb#
disp_locale=de : display_name=Arabisch #a=aaa, b=bbb#
-----------------
@@ -83,9 +83,9 @@ include_once( 'ut_common.inc' );
ut_run();
?>
--EXPECT--
--EXPECTF--
uk-ua_CALIFORNIA@currency=;currency=GRN: primary_language='uk'
root: primary_language='root'
root: primary_language='%S'
uk@currency=EURO: primary_language='uk'
Hindi: primary_language='hindi'
de: primary_language='de'
+2 -2
View File
@@ -96,13 +96,13 @@ include_once( 'ut_common.inc' );
ut_run();
?>
--EXPECT--
--EXPECTF--
---------------------
uk-ua_CALIFORNIA@currency=;currency=GRN:
language : 'uk' , region : 'UA' , variant0 : 'CALIFORNIA' ,
---------------------
root:
language : 'root' ,
%s
---------------------
uk@currency=EURO:
language : 'uk' ,
+10 -2
View File
@@ -567,8 +567,16 @@ again:
return php_json_encode_serializable_object(buf, val, options, encoder);
}
/* fallthrough -- Non-serializable object */
case IS_ARRAY:
return php_json_encode_array(buf, val, options, encoder);
case IS_ARRAY: {
/* Avoid modifications (and potential freeing) of the array through a reference when a
* jsonSerialize() method is invoked. */
zval zv;
int res;
ZVAL_COPY(&zv, val);
res = php_json_encode_array(buf, &zv, options, encoder);
zval_ptr_dtor_nogc(&zv);
return res;
}
case IS_REFERENCE:
val = Z_REFVAL_P(val);
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #77843: Use after free with json serializer
--FILE--
<?php
class X implements JsonSerializable {
public $prop = "value";
public function jsonSerialize() {
global $arr;
unset($arr[0]);
var_dump($this);
return $this;
}
}
$arr = [new X()];
var_dump(json_encode([&$arr]));
?>
--EXPECT--
object(X)#1 (1) {
["prop"]=>
string(5) "value"
}
string(20) "[[{"prop":"value"}]]"
+50
View File
@@ -0,0 +1,50 @@
--TEST--
ensure an error is returned when mysqli.allow_local_infile is off
--SKIPIF--
<?php
require_once('skipif.inc');
require_once('skipifconnectfailure.inc');
?>
--INI--
mysqli.allow_local_infile=0
--FILE--
<?php
require_once("connect.inc");
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("[001] Connect failed, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
}
if (!$link->query("DROP TABLE IF EXISTS test")) {
printf("[002] [%d] %s\n", $link->errno, $link->error);
}
if (!$link->query("CREATE TABLE test (dump1 INT UNSIGNED NOT NULL PRIMARY KEY) ENGINE=" . $engine)) {
printf("[003] [%d] %s\n", $link->errno, $link->error);
}
if (FALSE == file_put_contents('bug77956.data', "waa? meukee!"))
printf("[004] Failed to create CVS file\n");
if (!$link->query("SELECT 1 FROM DUAL"))
printf("[005] [%d] %s\n", $link->errno, $link->error);
if (!$link->query("LOAD DATA LOCAL INFILE 'bug77956.data' INTO TABLE test")) {
printf("[006] [%d] %s\n", $link->errno, $link->error);
echo "done";
} else {
echo "bug";
}
$link->close();
?>
--CLEAN--
<?php
require_once('connect.inc');
if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {
printf("[clean] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n",
$host, $user, $db, $port, $socket);
}
if (!$link->query($link, 'DROP TABLE IF EXISTS test')) {
printf("[clean] Failed to drop old test table: [%d] %s\n", mysqli_errno($link), mysqli_error($link));
}
$link->close();
unlink('bug77956.data');
?>
--EXPECTF--
Warning: mysqli::query(): LOAD DATA LOCAL INFILE forbidden in %s on line %d
[006] [2000] LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile
done
+2
View File
@@ -156,6 +156,8 @@ mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * const filenam
if (!(conn->options->flags & CLIENT_LOCAL_FILES)) {
php_error_docref(NULL, E_WARNING, "LOAD DATA LOCAL INFILE forbidden");
SET_CLIENT_ERROR(conn->error_info, CR_UNKNOWN_ERROR, UNKNOWN_SQLSTATE,
"LOAD DATA LOCAL INFILE is forbidden, check mysqli.allow_local_infile");
/* write empty packet to server */
ret = net->data->m.send(net, vio, empty_packet, 0, conn->stats, conn->error_info);
*is_warning = TRUE;
+8 -1
View File
@@ -612,7 +612,7 @@ mysqlnd_stmt_execute_prepare_param_types(MYSQLND_STMT_DATA * stmt, zval ** copie
zval *parameter = &stmt->param_bind[i].zv;
ZVAL_DEREF(parameter);
if (!Z_ISNULL_P(parameter) && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG)) {
if (!Z_ISNULL_P(parameter) && (current_type == MYSQL_TYPE_LONG || current_type == MYSQL_TYPE_LONGLONG || current_type == MYSQL_TYPE_TINY)) {
/* always copy the var, because we do many conversions */
if (Z_TYPE_P(parameter) != IS_LONG &&
PASS != mysqlnd_stmt_copy_it(copies_param, parameter, stmt->param_count, i))
@@ -825,6 +825,13 @@ mysqlnd_stmt_execute_store_param_values(MYSQLND_STMT_DATA * stmt, zval * copies,
int4store(*p, Z_LVAL_P(data));
(*p) += 4;
break;
case MYSQL_TYPE_TINY:
if (Z_TYPE_P(data) == IS_STRING) {
goto send_string;
}
int1store(*p, Z_LVAL_P(data));
(*p)++;
break;
case MYSQL_TYPE_LONG_BLOB:
if (stmt->param_bind[i].flags & MYSQLND_PARAM_BIND_BLOB_USED) {
stmt->param_bind[i].flags &= ~MYSQLND_PARAM_BIND_BLOB_USED;
+3 -2
View File
@@ -294,13 +294,14 @@ void MYSQLND_METHOD(mysqlnd_res, free_result_contents_internal)(MYSQLND_RES * re
{
DBG_ENTER("mysqlnd_res::free_result_contents_internal");
result->m.free_result_buffers(result);
if (result->meta) {
ZEND_ASSERT(zend_arena_contains(result->memory_pool->arena, result->meta));
result->meta->m->free_metadata(result->meta);
result->meta = NULL;
}
result->m.free_result_buffers(result);
DBG_VOID_RETURN;
}
/* }}} */
+148 -61
View File
@@ -74,11 +74,7 @@
* 16 of the SSA book.
*/
#if 0
#define SCP_DEBUG(...) php_printf(__VA_ARGS__)
#else
#define SCP_DEBUG(...)
#endif
#define SCP_DEBUG 0
typedef struct _sccp_ctx {
scdf_ctx scdf;
@@ -103,6 +99,24 @@ typedef struct _sccp_ctx {
#define MAKE_TOP(zv) (Z_TYPE_INFO_P(zv) = TOP)
#define MAKE_BOT(zv) (Z_TYPE_INFO_P(zv) = BOT)
static void scp_dump_value(zval *zv) {
if (IS_TOP(zv)) {
fprintf(stderr, " top");
} else if (IS_BOT(zv)) {
fprintf(stderr, " bot");
} else if (Z_TYPE_P(zv) == IS_ARRAY || IS_PARTIAL_ARRAY(zv)) {
fprintf(stderr, " %s[", IS_PARTIAL_ARRAY(zv) ? "partial " : "");
zend_dump_ht(Z_ARRVAL_P(zv));
fprintf(stderr, "]");
} else if (IS_PARTIAL_OBJECT(zv)) {
fprintf(stderr, " {");
zend_dump_ht(Z_ARRVAL_P(zv));
fprintf(stderr, "}");
} else {
zend_dump_const(zv);
}
}
static void empty_partial_array(zval *zv)
{
MAKE_PARTIAL_ARRAY(zv);
@@ -139,11 +153,15 @@ static void set_value(scdf_ctx *scdf, sccp_ctx *ctx, int var, zval *new) {
return;
}
if (IS_BOT(new)) {
SCP_DEBUG("Lowering var %d to BOT\n", var);
} else if (!IS_PARTIAL_ARRAY(new) && !IS_PARTIAL_OBJECT(new)) {
SCP_DEBUG("Lowering var %d to %Z\n", var, new);
}
#if SCP_DEBUG
fprintf(stderr, "Lowering #%d.", var);
zend_dump_var(scdf->op_array, IS_CV, scdf->ssa->vars[var].var);
fprintf(stderr, " from");
scp_dump_value(value);
fprintf(stderr, " to");
scp_dump_value(new);
fprintf(stderr, "\n");
#endif
if (IS_TOP(value) || IS_BOT(new)) {
zval_ptr_dtor_nogc(value);
@@ -358,6 +376,31 @@ static zend_bool try_replace_op2(
return 0;
}
static inline int ct_eval_binary_op(zval *result, zend_uchar binop, zval *op1, zval *op2) {
/* TODO: We could implement support for evaluation of + on partial arrays. */
if (IS_PARTIAL_ARRAY(op1) || IS_PARTIAL_ARRAY(op2)) {
return FAILURE;
}
return zend_optimizer_eval_binary_op(result, binop, op1, op2);
}
static inline int ct_eval_bool_cast(zval *result, zval *op) {
if (IS_PARTIAL_ARRAY(op)) {
if (zend_hash_num_elements(Z_ARRVAL_P(op)) == 0) {
/* An empty partial array may be non-empty at runtime, we don't know whether the
* result will be true or false. */
return FAILURE;
}
ZVAL_TRUE(result);
return SUCCESS;
}
ZVAL_BOOL(result, zend_is_true(op));
return SUCCESS;
}
static inline int zval_to_string_offset(zend_long *result, zval *op) {
switch (Z_TYPE_P(op)) {
case IS_LONG:
@@ -419,6 +462,23 @@ static inline int ct_eval_fetch_dim(zval *result, zval *op1, zval *op2, int supp
return FAILURE;
}
/* op1 may be NULL here to indicate an unset value */
static inline int ct_eval_isset_isempty(zval *result, uint32_t extended_value, zval *op1) {
zval zv;
if (!(extended_value & ZEND_ISEMPTY)) {
ZVAL_BOOL(result, op1 && Z_TYPE_P(op1) != IS_NULL);
return SUCCESS;
} else if (!op1) {
ZVAL_TRUE(result);
return SUCCESS;
} else if (ct_eval_bool_cast(&zv, op1) == SUCCESS) {
ZVAL_BOOL(result, Z_TYPE(zv) == IS_FALSE);
return SUCCESS;
} else {
return FAILURE;
}
}
static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval *op1, zval *op2) {
if (Z_TYPE_P(op1) == IS_ARRAY || IS_PARTIAL_ARRAY(op1)) {
zval *value;
@@ -428,12 +488,7 @@ static inline int ct_eval_isset_dim(zval *result, uint32_t extended_value, zval
if (IS_PARTIAL_ARRAY(op1) && (!value || IS_BOT(value))) {
return FAILURE;
}
if (!(extended_value & ZEND_ISEMPTY)) {
ZVAL_BOOL(result, value && Z_TYPE_P(value) != IS_NULL);
} else {
ZVAL_BOOL(result, !value || !zend_is_true(value));
}
return SUCCESS;
return ct_eval_isset_isempty(result, extended_value, value);
} else if (Z_TYPE_P(op1) == IS_STRING) {
// TODO
return FAILURE;
@@ -585,12 +640,7 @@ static inline int ct_eval_isset_obj(zval *result, uint32_t extended_value, zval
if (!value || IS_BOT(value)) {
return FAILURE;
}
if (!(extended_value & ZEND_ISEMPTY)) {
ZVAL_BOOL(result, value && Z_TYPE_P(value) != IS_NULL);
} else {
ZVAL_BOOL(result, !value || !zend_is_true(value));
}
return SUCCESS;
return ct_eval_isset_isempty(result, extended_value, value);
} else {
ZVAL_BOOL(result, (extended_value & ZEND_ISEMPTY));
return SUCCESS;
@@ -650,17 +700,14 @@ static inline int ct_eval_incdec(zval *result, zend_uchar opcode, zval *op1) {
return SUCCESS;
}
static inline int ct_eval_isset_isempty(zval *result, uint32_t extended_value, zval *op1) {
if (!(extended_value & ZEND_ISEMPTY)) {
ZVAL_BOOL(result, Z_TYPE_P(op1) != IS_NULL);
} else {
ZVAL_BOOL(result, !zend_is_true(op1));
}
return SUCCESS;
}
static inline void ct_eval_type_check(zval *result, uint32_t type_mask, zval *op1) {
ZVAL_BOOL(result, (type_mask >> Z_TYPE_P(op1)) & 1);
uint32_t type = Z_TYPE_P(op1);
if (type == PARTIAL_ARRAY) {
type = IS_ARRAY;
} else if (type == PARTIAL_OBJECT) {
type = IS_OBJECT;
}
ZVAL_BOOL(result, (type_mask >> type) & 1);
}
static inline int ct_eval_in_array(zval *result, uint32_t extended_value, zval *op1, zval *op2) {
@@ -1238,7 +1285,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
/* We want to avoid keeping around intermediate arrays for each SSA variable in the
* ADD_ARRAY_ELEMENT chain. We do this by only keeping the array on the last opcode
* and use a NULL value everywhere else. */
if (Z_TYPE(ctx->values[ssa_op->result_def]) == IS_NULL) {
if (result && Z_TYPE_P(result) == IS_NULL) {
SET_RESULT_BOT(result);
return;
}
@@ -1359,7 +1406,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
SKIP_IF_TOP(op1);
SKIP_IF_TOP(op2);
if (zend_optimizer_eval_binary_op(&zv, opline->opcode, op1, op2) == SUCCESS) {
if (ct_eval_binary_op(&zv, opline->opcode, op1, op2) == SUCCESS) {
SET_RESULT(result, &zv);
zval_ptr_dtor_nogc(&zv);
break;
@@ -1385,7 +1432,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
SKIP_IF_TOP(op2);
}
if (!opline->extended_value) {
if (zend_optimizer_eval_binary_op(&zv, zend_compound_assign_to_binary_op(opline->opcode), op1, op2) == SUCCESS) {
if (ct_eval_binary_op(&zv, zend_compound_assign_to_binary_op(opline->opcode), op1, op2) == SUCCESS) {
SET_RESULT(op1, &zv);
SET_RESULT(result, &zv);
zval_ptr_dtor_nogc(&zv);
@@ -1412,7 +1459,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
break;
}
if (zend_optimizer_eval_binary_op(&tmp, zend_compound_assign_to_binary_op(opline->opcode), &tmp, data) != SUCCESS) {
if (ct_eval_binary_op(&tmp, zend_compound_assign_to_binary_op(opline->opcode), &tmp, data) != SUCCESS) {
SET_RESULT_BOT(result);
SET_RESULT_BOT(op1);
zval_ptr_dtor_nogc(&tmp);
@@ -1457,7 +1504,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
break;
}
if (zend_optimizer_eval_binary_op(&tmp, zend_compound_assign_to_binary_op(opline->opcode), &tmp, data) != SUCCESS) {
if (ct_eval_binary_op(&tmp, zend_compound_assign_to_binary_op(opline->opcode), &tmp, data) != SUCCESS) {
SET_RESULT_BOT(result);
SET_RESULT_BOT(op1);
zval_ptr_dtor_nogc(&tmp);
@@ -1540,6 +1587,10 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
case ZEND_BW_NOT:
case ZEND_BOOL_NOT:
SKIP_IF_TOP(op1);
if (IS_PARTIAL_ARRAY(op1)) {
SET_RESULT_BOT(result);
break;
}
if (zend_optimizer_eval_unary_op(&zv, opline->opcode, op1) == SUCCESS) {
SET_RESULT(result, &zv);
zval_ptr_dtor_nogc(&zv);
@@ -1549,6 +1600,10 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
break;
case ZEND_CAST:
SKIP_IF_TOP(op1);
if (IS_PARTIAL_ARRAY(op1)) {
SET_RESULT_BOT(result);
break;
}
if (zend_optimizer_eval_cast(&zv, opline->extended_value, op1) == SUCCESS) {
SET_RESULT(result, &zv);
zval_ptr_dtor_nogc(&zv);
@@ -1560,8 +1615,12 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
case ZEND_JMPZ_EX:
case ZEND_JMPNZ_EX:
SKIP_IF_TOP(op1);
ZVAL_BOOL(&zv, zend_is_true(op1));
SET_RESULT(result, &zv);
if (ct_eval_bool_cast(&zv, op1) == SUCCESS) {
SET_RESULT(result, &zv);
zval_ptr_dtor_nogc(&zv);
break;
}
SET_RESULT_BOT(result);
break;
case ZEND_STRLEN:
SKIP_IF_TOP(op1);
@@ -1679,6 +1738,10 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
break;
case ZEND_ROPE_INIT:
SKIP_IF_TOP(op2);
if (IS_PARTIAL_ARRAY(op2)) {
SET_RESULT_BOT(result);
break;
}
if (zend_optimizer_eval_cast(&zv, IS_STRING, op2) == SUCCESS) {
SET_RESULT(result, &zv);
zval_ptr_dtor_nogc(&zv);
@@ -1693,7 +1756,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
// string for all SSA vars with some extra checks
SKIP_IF_TOP(op1);
SKIP_IF_TOP(op2);
if (zend_optimizer_eval_binary_op(&zv, ZEND_CONCAT, op1, op2) == SUCCESS) {
if (ct_eval_binary_op(&zv, ZEND_CONCAT, op1, op2) == SUCCESS) {
SET_RESULT(result, &zv);
zval_ptr_dtor_nogc(&zv);
break;
@@ -1735,7 +1798,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
args[i] = get_op1_value(ctx, opline,
&ctx->scdf.ssa->ops[opline - ctx->scdf.op_array->opcodes]);
if (args[i]) {
if (IS_BOT(args[i])) {
if (IS_BOT(args[i]) || IS_PARTIAL_ARRAY(args[i])) {
SET_RESULT_BOT(result);
return;
} else if (IS_TOP(args[i])) {
@@ -1785,7 +1848,7 @@ static void sccp_mark_feasible_successors(
int block_num, zend_basic_block *block,
zend_op *opline, zend_ssa_op *ssa_op) {
sccp_ctx *ctx = (sccp_ctx *) scdf;
zval *op1;
zval *op1, zv;
int s;
/* We can't determine the branch target at compile-time for these */
@@ -1820,19 +1883,36 @@ static void sccp_mark_feasible_successors(
case ZEND_JMPZ:
case ZEND_JMPZNZ:
case ZEND_JMPZ_EX:
s = zend_is_true(op1);
{
if (ct_eval_bool_cast(&zv, op1) == FAILURE) {
scdf_mark_edge_feasible(scdf, block_num, block->successors[0]);
scdf_mark_edge_feasible(scdf, block_num, block->successors[1]);
return;
}
s = Z_TYPE(zv) == IS_TRUE;
break;
}
case ZEND_JMPNZ:
case ZEND_JMPNZ_EX:
case ZEND_JMP_SET:
s = !zend_is_true(op1);
{
if (ct_eval_bool_cast(&zv, op1) == FAILURE) {
scdf_mark_edge_feasible(scdf, block_num, block->successors[0]);
scdf_mark_edge_feasible(scdf, block_num, block->successors[1]);
return;
}
s = Z_TYPE(zv) == IS_FALSE;
break;
}
case ZEND_COALESCE:
s = (Z_TYPE_P(op1) == IS_NULL);
break;
case ZEND_FE_RESET_R:
case ZEND_FE_RESET_RW:
if (Z_TYPE_P(op1) != IS_ARRAY && !IS_PARTIAL_ARRAY(op1)) {
/* A non-empty partial array is definitely non-empty, but an
* empty partial array may be non-empty at runtime. */
if (Z_TYPE_P(op1) != IS_ARRAY ||
(IS_PARTIAL_ARRAY(op1) && zend_hash_num_elements(Z_ARR_P(op1)) == 0)) {
scdf_mark_edge_feasible(scdf, block_num, block->successors[0]);
scdf_mark_edge_feasible(scdf, block_num, block->successors[1]);
return;
@@ -1947,7 +2027,9 @@ static void sccp_visit_phi(scdf_ctx *scdf, zend_ssa_phi *phi) {
int i;
zval result;
MAKE_TOP(&result);
SCP_DEBUG("Handling PHI(");
#if SCP_DEBUG
fprintf(stderr, "Handling phi(");
#endif
if (phi->pi >= 0) {
ZEND_ASSERT(phi->sources[0] >= 0);
if (scdf_is_edge_feasible(scdf, phi->pi, phi->block)) {
@@ -1957,14 +2039,21 @@ static void sccp_visit_phi(scdf_ctx *scdf, zend_ssa_phi *phi) {
for (i = 0; i < block->predecessors_count; i++) {
ZEND_ASSERT(phi->sources[i] >= 0);
if (scdf_is_edge_feasible(scdf, predecessors[i], phi->block)) {
SCP_DEBUG("val, ");
#if SCP_DEBUG
scp_dump_value(&ctx->values[phi->sources[i]]);
fprintf(stderr, ",");
#endif
join_phi_values(&result, &ctx->values[phi->sources[i]], ssa->vars[phi->ssa_var].escape_state != ESCAPE_STATE_NO_ESCAPE);
} else {
SCP_DEBUG("--, ");
#if SCP_DEBUG
fprintf(stderr, " --,");
#endif
}
}
}
SCP_DEBUG(")\n");
#if SCP_DEBUG
fprintf(stderr, ")\n");
#endif
set_value(scdf, ctx, phi->ssa_var, &result);
zval_ptr_dtor_nogc(&result);
@@ -2114,6 +2203,14 @@ static int try_remove_definition(sccp_ctx *ctx, int var_num, zend_ssa_var *var,
zend_ssa_remove_result_def(ssa, ssa_op);
if (opline->opcode == ZEND_DO_ICALL) {
removed_ops = remove_call(ctx, opline, ssa_op);
} else if (opline->opcode == ZEND_TYPE_CHECK
&& !value_known(&ctx->values[ssa_op->op1_use])) {
/* For TYPE_CHECK we may compute the result value without knowing the
* operand, based on type inference information. Make sure the operand is
* freed and leave further cleanup to DCE. */
opline->opcode = ZEND_FREE;
opline->result_type = IS_UNUSED;
removed_ops++;
} else {
zend_ssa_remove_instr(ssa, opline, ssa_op);
removed_ops++;
@@ -2372,18 +2469,8 @@ int sccp_optimize_op_array(zend_optimizer_ctx *ctx, zend_op_array *op_array, zen
}
fprintf(stderr, " #%d.", i);
zend_dump_var(op_array, IS_CV, ssa->vars[i].var);
if (Z_TYPE_P(zv) == IS_ARRAY || IS_PARTIAL_ARRAY(zv)) {
fprintf(stderr, " = %s[", IS_PARTIAL_ARRAY(zv) ? "partial " : "");
zend_dump_ht(Z_ARRVAL_P(zv));
fprintf(stderr, "]");
} else if (IS_PARTIAL_OBJECT(zv)) {
fprintf(stderr, " = {");
zend_dump_ht(Z_ARRVAL_P(zv));
fprintf(stderr, "}");
} else {
fprintf(stderr, " =");
zend_dump_const(zv);
}
fprintf(stderr, " =");
scp_dump_value(zv);
fprintf(stderr, "\n");
}
}
+1 -1
View File
@@ -126,7 +126,7 @@ static void zend_dump_unused_op(const zend_op *opline, znode_op op, uint32_t fla
zend_dump_class_fetch_type(op.num);
} else if (ZEND_VM_OP_CONSTRUCTOR == (flags & ZEND_VM_OP_MASK)) {
fprintf(stderr, " CONSTRUCTOR");
} else if (ZEND_VM_OP_CONST_FETCH == (flags & ZEND_VM_EXT_MASK)) {
} else if (ZEND_VM_OP_CONST_FETCH == (flags & ZEND_VM_OP_MASK)) {
if (op.num & IS_CONSTANT_UNQUALIFIED) {
fprintf(stderr, " (unqualified)");
}
+10 -8
View File
@@ -1688,8 +1688,9 @@ int zend_func_info_rid = -1;
uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa)
{
uint32_t ret = 0;
const zend_function *callee_func = call_info->callee_func;
if (call_info->callee_func->type == ZEND_INTERNAL_FUNCTION) {
if (callee_func->type == ZEND_INTERNAL_FUNCTION) {
zval *zv;
func_info_t *info;
@@ -1700,9 +1701,10 @@ uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa
ret = MAY_BE_NULL;
} else if (info->info_func) {
ret = info->info_func(call_info, ssa);
} else if (/*call_info->callee_func->common.arg_info && */
call_info->callee_func->common.num_args == 0 &&
call_info->callee_func->common.required_num_args == 0) {
} else if (/*callee_func->common.arg_info && */
callee_func->common.num_args == 0 &&
callee_func->common.required_num_args == 0 &&
!(callee_func->common.fn_flags & ZEND_ACC_VARIADIC)) {
if (call_info->num_args == 0) {
ret = info->info;
} else {
@@ -1718,19 +1720,19 @@ uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa
}
} else {
// FIXME: the order of functions matters!!!
zend_func_info *info = ZEND_FUNC_INFO((zend_op_array*)call_info->callee_func);
zend_func_info *info = ZEND_FUNC_INFO((zend_op_array*)callee_func);
if (info) {
ret = info->return_info.type;
}
}
if (!ret) {
ret = MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
if (call_info->callee_func->type == ZEND_INTERNAL_FUNCTION) {
if (callee_func->type == ZEND_INTERNAL_FUNCTION) {
ret |= FUNC_MAY_WARN;
}
if (call_info->callee_func->common.fn_flags & ZEND_ACC_GENERATOR) {
if (callee_func->common.fn_flags & ZEND_ACC_GENERATOR) {
ret = MAY_BE_RC1 | MAY_BE_RCN | MAY_BE_OBJECT;
} else if (call_info->callee_func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
} else if (callee_func->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) {
ret |= MAY_BE_REF;
} else {
ret |= MAY_BE_RC1 | MAY_BE_RCN;
+4 -2
View File
@@ -2895,8 +2895,10 @@ static int zend_update_type_info(const zend_op_array *op_array,
tmp = t1;
if (t1 & MAY_BE_ARRAY) {
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
/* SEND_UNPACK may acquire references into the array */
tmp |= MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
if (t1 & MAY_BE_ARRAY_OF_ANY) {
/* SEND_UNPACK may acquire references into the array */
tmp |= MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF;
}
}
if (t1 & MAY_BE_OBJECT) {
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
+21 -24
View File
@@ -431,7 +431,7 @@ static zend_always_inline zend_string *accel_find_interned_string(zend_string *s
}
if (!ZCG(counted)) {
if (accel_activate_add() == FAILURE) {
if (!ZCG(accelerator_enabled) || accel_activate_add() == FAILURE) {
return str;
}
ZCG(counted) = 1;
@@ -572,10 +572,7 @@ static void accel_copy_permanent_strings(zend_new_interned_string_func_t new_int
/* empty string */
zend_empty_string = new_interned_string(zend_empty_string);
for (j = 0; j < 256; j++) {
char s[2];
s[0] = j;
s[1] = 0;
zend_one_char_string[j] = new_interned_string(zend_string_init(s, 1, 0));
zend_one_char_string[j] = new_interned_string(ZSTR_CHAR(j));
}
for (j = 0; j < ZEND_STR_LAST_KNOWN; j++) {
zend_known_strings[j] = new_interned_string(zend_known_strings[j]);
@@ -739,12 +736,11 @@ static zend_string* ZEND_FASTCALL accel_replace_string_by_shm_permanent(zend_str
static zend_string* ZEND_FASTCALL accel_replace_string_by_process_permanent(zend_string *str)
{
zend_string *ret = zend_interned_string_find_permanent(str);
if (ret) {
zend_string_release(str);
return ret;
}
ZEND_ASSERT(0);
ZEND_ASSERT(!IS_ACCEL_INTERNED(str));
return str;
}
@@ -1168,7 +1164,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
cwd_len = ZSTR_LEN(cwd_str);
if (ZCG(cwd_check)) {
ZCG(cwd_check) = 0;
if ((ZCG(counted) || ZCSG(accelerator_enabled))) {
if (ZCG(accelerator_enabled)) {
zend_string *str = accel_find_interned_string(cwd_str);
if (!str) {
@@ -1208,7 +1204,7 @@ char *accel_make_persistent_key(const char *path, size_t path_length, int *key_l
if (ZCG(include_path_check)) {
ZCG(include_path_check) = 0;
if ((ZCG(counted) || ZCSG(accelerator_enabled))) {
if (ZCG(accelerator_enabled)) {
zend_string *str = accel_find_interned_string(ZCG(include_path));
if (!str) {
@@ -1291,7 +1287,7 @@ int zend_accel_invalidate(const char *filename, size_t filename_len, zend_bool f
zend_string *realpath;
zend_persistent_script *persistent_script;
if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
if (!ZCG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
return FAILURE;
}
@@ -1387,6 +1383,10 @@ static zend_persistent_script *store_script_in_file_cache(zend_persistent_script
/* Align to 64-byte boundary */
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 64);
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 63L) & ~63L);
#elif ZEND_MM_ALIGNMENT < 8
/* Align to 8-byte boundary */
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used + 8);
ZCG(mem) = (void*)(((zend_uintptr_t)ZCG(mem) + 7L) & ~7L);
#else
ZCG(mem) = zend_arena_alloc(&CG(arena), memory_used);
#endif
@@ -1914,7 +1914,7 @@ zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int type)
} else if (file_cache_only) {
return file_cache_compile_file(file_handle, type);
#endif
} else if ((!ZCG(counted) && !ZCSG(accelerator_enabled)) ||
} else if (!ZCG(accelerator_enabled) ||
(ZCSG(restart_in_progress) && accel_restart_is_active())) {
#ifdef HAVE_OPCACHE_FILE_CACHE
if (ZCG(accel_directives).file_cache) {
@@ -2209,12 +2209,11 @@ static int persistent_stream_open_function(const char *filename, zend_file_handl
/* zend_resolve_path() replacement for PHP 5.3 and above */
static zend_string* persistent_zend_resolve_path(const char *filename, size_t filename_len)
{
if (ZCG(enabled) && accel_startup_ok &&
if (
#ifdef HAVE_OPCACHE_FILE_CACHE
!file_cache_only &&
#endif
(ZCG(counted) || ZCSG(accelerator_enabled)) &&
!ZCSG(restart_in_progress)) {
ZCG(accelerator_enabled)) {
/* check if callback is called from include_once or it's a main request */
if ((!EG(current_execute_data) &&
@@ -2315,8 +2314,6 @@ static void accel_reset_pcre_cache(void)
static void accel_activate(void)
{
zend_bool reset_pcre = 0;
if (!ZCG(enabled) || !accel_startup_ok) {
return;
}
@@ -2363,6 +2360,7 @@ static void accel_activate(void)
zend_alter_ini_entry_chars(key, "0", 1, ZEND_INI_SYSTEM, ZEND_INI_STAGE_RUNTIME);
zend_string_release_ex(key, 0);
zend_accel_error(ACCEL_LOG_WARNING, "Can't cache files in chroot() directory with too big inode");
ZCG(accelerator_enabled) = 0;
return;
}
}
@@ -2420,16 +2418,16 @@ static void accel_activate(void)
}
accel_restart_leave();
}
} else {
reset_pcre = 1;
}
zend_shared_alloc_unlock();
}
ZCG(accelerator_enabled) = ZCSG(accelerator_enabled);
SHM_PROTECT();
HANDLE_UNBLOCK_INTERRUPTIONS();
if (ZCSG(last_restart_time) != ZCG(last_restart_time)) {
if (ZCG(accelerator_enabled) && ZCSG(last_restart_time) != ZCG(last_restart_time)) {
/* SHM was reinitialized. */
ZCG(last_restart_time) = ZCSG(last_restart_time);
@@ -2437,8 +2435,10 @@ static void accel_activate(void)
realpath_cache_clean();
accel_reset_pcre_cache();
} else if (reset_pcre) {
ZCG(pcre_reseted) = 0;
} else if (!ZCG(accelerator_enabled) && !ZCG(pcre_reseted)) {
accel_reset_pcre_cache();
ZCG(pcre_reseted) = 1;
}
}
@@ -2466,10 +2466,6 @@ static void accel_deactivate(void)
zend_string_release_ex(ZCG(cwd), 0);
ZCG(cwd) = NULL;
}
if (!ZCG(enabled) || !accel_startup_ok) {
return;
}
}
static int accelerator_remove_cb(zend_extension *element1, zend_extension *element2)
@@ -2511,6 +2507,7 @@ static inline int accel_find_sapi(void)
"cli-server",
"cgi-fcgi",
"fpm-fcgi",
"fpmi-fcgi",
"apache2handler",
"litespeed",
"uwsgi",
+2
View File
@@ -195,6 +195,8 @@ typedef struct _zend_accel_globals {
int counted; /* the process uses shared memory */
zend_bool enabled;
zend_bool locked; /* thread obtained exclusive lock */
zend_bool accelerator_enabled; /* accelerator enabled for current request */
zend_bool pcre_reseted;
HashTable bind_hash; /* prototype and zval lookup table */
zend_accel_directives accel_directives;
zend_string *cwd; /* current working directory or NULL */
+1
View File
@@ -4,6 +4,7 @@ Bug #66461 (PHP crashes if opcache.interned_strings_buffer=0)
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
opcache.log_verbosity_level=1
opcache.file_update_protection=0
opcache.interned_strings_buffer=0
--SKIPIF--
+1 -1
View File
@@ -3,7 +3,7 @@ Bug #71443 (Segfault using built-in webserver with intl using symfony)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_cache=/tmp/
opcache.file_cache={TMP}
opcache.file_cache_only=1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
+1 -1
View File
@@ -3,7 +3,7 @@ Bug #76275: Assertion failure in file cache when unserializing empty try_catch_a
--INI--
opcache.enabled=1
opcache.enable_cli=1
opcache.file_cache=/tmp
opcache.file_cache={TMP}
--FILE--
<?php
if (PHP_VERSION_ID >= 70000) {
+113
View File
@@ -0,0 +1,113 @@
--TEST--
Bug #78015: Incorrect evaluation of expressions involving partials array in SCCP
--FILE--
<?php
$x = 1;
function test1() {
global $x;
$a = ['b' => [$x], 'c' => [$x]];
$d = $a['b'] + $a['c'];
return $d;
}
function test2() {
global $x;
$a = ['b' => [$x]];
$d = !$a['b'];
return $d;
}
function test3() {
global $x;
$a = ['b' => [$x]];
$d = (int) $a['b'];
return $d;
}
function test4() {
global $x;
$a = ['b' => [$x]];
$d = $a['b'] ?: 42;
return $d;
}
function test5() {
global $x;
$a = ['b' => [$x]];
$d = is_array($a['b']);
return $d;
}
function test6() {
global $x;
$a = ['b' => [$x]];
$b = "foo";
$d = "$a[b]{$b}bar";
return $d;
}
function test7() {
global $x;
$a = ['b' => [$x]];
$y = 1;
foreach ($a['b'] as $_) {
$y = 2;
}
return $y;
}
function test8($array) {
$i = 0;
$ret = [[]];
foreach ($array as $_) {
$i++;
$ret = [[
'x' => 0,
'y' => $i,
]];
}
return $ret[0];
}
function test9() {
global $x;
$a = ['b' => [$x]];
return serialize($a['b']);
}
var_dump(test1());
var_dump(test2());
var_dump(test3());
var_dump(test4());
var_dump(test5());
var_dump(test6());
var_dump(test7());
var_dump(test8([1]));
var_dump(test9());
?>
--EXPECTF--
array(1) {
[0]=>
int(1)
}
bool(false)
int(1)
array(1) {
[0]=>
int(1)
}
bool(true)
Notice: Array to string conversion in %s on line %d
string(11) "Arrayfoobar"
int(2)
array(2) {
["x"]=>
int(0)
["y"]=>
int(1)
}
string(14) "a:1:{i:0;i:1;}"
+1
View File
@@ -8,6 +8,7 @@ The process should die regardless of the log_verbosity_level.
opcache.enable=1
opcache.enable_cli=1
opcache.file_cache_only=0
opcache.file_cache_fallback=0
opcache.memory_consumption=999999999
opcache.log_verbosity_level=-1
--SKIPIF--
+17
View File
@@ -0,0 +1,17 @@
--TEST--
SCCP 030: TYPE_CHECK inferred from type inference info
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
opcache.opt_debug_level=0
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
var_dump(is_string(sys_get_temp_dir()));
?>
--EXPECT--
bool(true)
@@ -0,0 +1,24 @@
--TEST--
Type inference of SEND_UNPACK with empty array
--FILE--
<?php
function test() {
$array = [1, 2, 3];
$values = [];
var_dump(array_push($array, 4, ...$values));
var_dump($array);
}
test();
?>
--EXPECT--
int(4)
array(4) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
}
+1
View File
@@ -7,6 +7,7 @@ outputs the correct logging at the highest log_verbosity_level
opcache.enable=1
opcache.enable_cli=1
opcache.file_cache_only=0
opcache.error_log=
opcache.log_verbosity_level=4
opcache.huge_code_pages=0
--SKIPIF--
+10 -7
View File
@@ -438,11 +438,11 @@ void zend_accel_info(ZEND_MODULE_INFO_FUNC_ARGS)
{
php_info_print_table_start();
if (ZCG(enabled) && accel_startup_ok &&
if (
#ifdef HAVE_OPCACHE_FILE_CACHE
((ZCG(counted) || ZCSG(accelerator_enabled)) || file_cache_only)
(ZCG(accelerator_enabled) || file_cache_only)
#else
(ZCG(counted) || ZCSG(accelerator_enabled))
(ZCG(accelerator_enabled))
#endif
) {
php_info_print_table_row(2, "Opcode Caching", "Up and Running");
@@ -546,7 +546,7 @@ static int accelerator_get_scripts(zval *return_value)
struct timeval exec_time;
struct timeval fetch_time;
if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
if (!ZCG(accelerator_enabled) || accelerator_shm_read_lock() != SUCCESS) {
return 0;
}
@@ -608,7 +608,7 @@ static ZEND_FUNCTION(opcache_get_status)
array_init(return_value);
/* Trivia */
add_assoc_bool(return_value, "opcache_enabled", ZCG(enabled) && (ZCG(counted) || ZCSG(accelerator_enabled)));
add_assoc_bool(return_value, "opcache_enabled", ZCG(accelerator_enabled));
#ifdef HAVE_OPCACHE_FILE_CACHE
if (ZCG(accel_directives).file_cache) {
@@ -766,7 +766,10 @@ static ZEND_FUNCTION(opcache_reset)
RETURN_FALSE;
}
/* exclusive lock */
zend_shared_alloc_lock();
zend_accel_schedule_restart(ACCEL_RESTART_USER);
zend_shared_alloc_unlock();
RETURN_TRUE;
}
@@ -805,7 +808,7 @@ static ZEND_FUNCTION(opcache_compile_file)
return;
}
if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) {
if (!ZCG(accelerator_enabled)) {
zend_error(E_NOTICE, ACCELERATOR_PRODUCT_NAME " seems to be disabled, can't compile file");
RETURN_FALSE;
}
@@ -844,7 +847,7 @@ static ZEND_FUNCTION(opcache_is_script_cached)
RETURN_FALSE;
}
if (!ZCG(enabled) || !accel_startup_ok || !ZCSG(accelerator_enabled)) {
if (!ZCG(accelerator_enabled)) {
RETURN_FALSE;
}
+4 -1
View File
@@ -6496,7 +6496,10 @@ static int php_openssl_cipher_init(const EVP_CIPHER *cipher_type,
return FAILURE;
}
if (mode->is_single_run_aead && enc) {
EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_set_tag_flag, tag_len, NULL);
if (!EVP_CIPHER_CTX_ctrl(cipher_ctx, mode->aead_set_tag_flag, tag_len, NULL)) {
php_error_docref(NULL, E_WARNING, "Setting tag length for AEAD cipher failed");
return FAILURE;
}
} else if (!enc && tag && tag_len > 0) {
if (!mode->is_aead) {
php_error_docref(NULL, E_WARNING, "The tag cannot be used because the cipher method does not support AEAD");
+1 -1
View File
@@ -13,7 +13,7 @@ $clientCtx = stream_context_create(['ssl' => [
// We can't use http://curl.haxx.se/ca/cacert.pem for this test
// as it is redirected to https which means the test would depend
// on system cafile when opening stream.
'cafile' => 'http://www.php.net',
'cafile' => 'http://www.nginx.org',
]]);
file_get_contents('https://github.com', false, $clientCtx);
?>
+9 -3
View File
@@ -24,9 +24,12 @@ foreach ($tests as $idx => $test) {
// Empty IV error
var_dump(openssl_encrypt('data', $method, 'password', 0, NULL, $tag, ''));
// Test setting different IV length and unlimeted tag
var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 10), $tag, '', 1024));
// Test setting different IV length and tag length
var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 10), $tag, '', 14));
var_dump(strlen($tag));
// Test setting invalid tag length
var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 16), $tag, '', 1024));
?>
--EXPECTF--
TEST 0
@@ -36,4 +39,7 @@ bool(true)
Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed in %s on line %d
bool(false)
string(8) "p/lvgA=="
int(1024)
int(14)
Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed in %s on line %d
bool(false)
+1
View File
@@ -875,6 +875,7 @@ static int php_openssl_enable_peer_verification(SSL_CTX *ctx, php_stream *stream
if (cafile || capath) {
if (!SSL_CTX_load_verify_locations(ctx, cafile, capath)) {
ERR_clear_error();
if (cafile && !php_openssl_load_stream_cafile(SSL_CTX_get_cert_store(ctx), cafile)) {
return FAILURE;
}
+5 -1
View File
@@ -558,6 +558,10 @@ static int pdo_mysql_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_da
mysqlnd_stmt_bind_one_param(S->stmt, param->paramno, parameter, MYSQL_TYPE_LONG);
#endif /* SIZEOF_LONG */
break;
case IS_TRUE:
case IS_FALSE:
mysqlnd_stmt_bind_one_param(S->stmt, param->paramno, parameter, MYSQL_TYPE_TINY);
break;
case IS_DOUBLE:
mysqlnd_stmt_bind_one_param(S->stmt, param->paramno, parameter, MYSQL_TYPE_DOUBLE);
break;
@@ -874,7 +878,7 @@ static int pdo_mysql_stmt_col_meta(pdo_stmt_t *stmt, zend_long colno, zval *retu
case MYSQL_TYPE_SHORT:
case MYSQL_TYPE_INT24:
case MYSQL_TYPE_LONG:
#if SIZEOF_LONG==8
#if SIZEOF_ZEND_LONG==8
case MYSQL_TYPE_LONGLONG:
#endif
add_assoc_long(return_value, "pdo_type", PDO_PARAM_INT);
+285
View File
@@ -0,0 +1,285 @@
--TEST--
PDO MySQL Bug #38546 (bindParam incorrect processing of bool types)
--SKIPIF--
<?php
if (!extension_loaded('pdo') || !extension_loaded('pdo_mysql')) die('skip not loaded');
require dirname(__FILE__) . '/config.inc';
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
require dirname(__FILE__) . '/config.inc';
require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
// To test error cases.
$db->exec("SET sql_mode='STRICT_TRANS_TABLES'");
$db->exec("DROP TABLE IF EXISTS test");
$query = "CREATE TABLE test(
uid MEDIUMINT UNSIGNED NOT NULL,
some_bool_1 BOOL NOT NULL,
some_bool_2 BOOL NOT NULL,
some_int TINYINT NOT NULL
)";
$db->exec($query);
$st = $db->prepare("INSERT INTO test (uid, some_bool_1, some_bool_2, some_int) VALUES (?, ?, ?, ?)");
$values = [
'uid' => 6,
'some_bool_1' => false,
'some_bool_2' => true,
'some_int' => -23
];
$st->bindParam(1, $values['uid'], PDO::PARAM_INT);
$st->bindParam(2, $values['some_bool_1'], PDO::PARAM_BOOL);
$st->bindParam(3, $values['some_bool_2'], PDO::PARAM_BOOL);
$st->bindParam(4, $values['some_int'], PDO::PARAM_INT);
$result = $st->execute();
if ($result === false) {
var_dump($st->errorInfo());
} else {
print("ok insert\n");
}
foreach ($db->query('SELECT * from test') as $row) {
print_r($row);
}
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
$values = [
'uid' => 6,
'some_bool_1' => (bool) 1,
'some_bool_2' => (bool) 0,
'some_int' => 1,
];
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
$result = $st->execute();
if ($result === false) {
var_dump($st->errorInfo());
} else {
print("ok prepare 1\n");
}
foreach ($db->query('SELECT * from test') as $row) {
print_r($row);
}
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
$values = [
'uid' => 6,
'some_bool_1' => (bool) 0,
'some_bool_2' => (bool) 1,
'some_int' => 2,
];
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
$result = $st->execute();
if ($result === false) {
var_dump($st->errorInfo());
} else {
print("ok prepare 2\n");
}
foreach ($db->query('SELECT * from test') as $row) {
print_r($row);
}
// String true and false should fail
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
$values = [
'uid' => 6,
'some_bool_1' => 'true',
'some_bool_2' => 'false',
'some_int' => 3,
];
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
$result = $st->execute();
if ($result === false) {
var_dump($st->errorInfo());
} else {
print("ok prepare 3\n");
}
foreach ($db->query('SELECT * from test') as $row) {
print_r($row);
}
// Null should not be treated as false
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
$values = [
'uid' => 6,
'some_bool_1' => true,
'some_bool_2' => null,
'some_int' => 4,
];
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
$result = $st->execute();
if ($result === false) {
var_dump($st->errorInfo());
} else {
print("ok prepare 4\n");
}
foreach ($db->query('SELECT * from test') as $row) {
print_r($row);
}
// Integers converted correctly
$st = $db->prepare("UPDATE test SET some_bool_1=?, some_bool_2=?, some_int=? WHERE uid=?");
$values = [
'uid' => 6,
'some_bool_1' => 256,
'some_bool_2' => 0,
'some_int' => 5,
];
$st->bindParam(1, $values['some_bool_1'], PDO::PARAM_BOOL);
$st->bindParam(2, $values['some_bool_2'], PDO::PARAM_BOOL);
$st->bindParam(3, $values['some_int'], PDO::PARAM_INT);
$st->bindParam(4, $values['uid'], PDO::PARAM_INT);
$result = $st->execute();
if ($result === false) {
var_dump($st->errorInfo());
} else {
print("ok prepare 5\n");
}
foreach ($db->query('SELECT * from test') as $row) {
print_r($row);
}
?>
--CLEAN--
<?php
require dirname(__FILE__) . '/mysql_pdo_test.inc';
MySQLPDOTest::dropTestTable();
?>
--EXPECTF--
ok insert
Array
(
[uid] => 6
[0] => 6
[some_bool_1] => 0
[1] => 0
[some_bool_2] => 1
[2] => 1
[some_int] => -23
[3] => -23
)
ok prepare 1
Array
(
[uid] => 6
[0] => 6
[some_bool_1] => 1
[1] => 1
[some_bool_2] => 0
[2] => 0
[some_int] => 1
[3] => 1
)
ok prepare 2
Array
(
[uid] => 6
[0] => 6
[some_bool_1] => 0
[1] => 0
[some_bool_2] => 1
[2] => 1
[some_int] => 2
[3] => 2
)
Warning: PDOStatement::execute(): SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'true' for column 'some_bool_1' at row 1 in %s
array(3) {
[0]=>
string(5) "HY000"
[1]=>
int(1366)
[2]=>
string(65) "Incorrect integer value: 'true' for column 'some_bool_1' at row 1"
}
Array
(
[uid] => 6
[0] => 6
[some_bool_1] => 0
[1] => 0
[some_bool_2] => 1
[2] => 1
[some_int] => 2
[3] => 2
)
Warning: PDOStatement::execute(): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'some_bool_2' cannot be null in %s
array(3) {
[0]=>
string(5) "23000"
[1]=>
int(1048)
[2]=>
string(35) "Column 'some_bool_2' cannot be null"
}
Array
(
[uid] => 6
[0] => 6
[some_bool_1] => 0
[1] => 0
[some_bool_2] => 1
[2] => 1
[some_int] => 2
[3] => 2
)
ok prepare 5
Array
(
[uid] => 6
[0] => 6
[some_bool_1] => 1
[1] => 1
[some_bool_2] => 0
[2] => 0
[some_int] => 5
[3] => 5
)
+16 -4
View File
@@ -37,8 +37,6 @@ function bug_44707($db) {
$stmt = $db->prepare('INSERT INTO test(id, mybool) VALUES (?, ?)');
$stmt->bindParam(1, $id);
// From MySQL 4.1 on boolean and TINYINT don't match! INSERT will fail.
// Versions prior to 4.1 have a weak test and will accept this.
$stmt->bindParam(2, $mybool, PDO::PARAM_BOOL);
var_dump($mybool);
@@ -78,8 +76,6 @@ Native Prepared Statements
bool(false)
bool(false)
bool(false)
array(0) {
}
array(1) {
[0]=>
array(2) {
@@ -89,4 +85,20 @@ array(1) {
string(1) "0"
}
}
array(2) {
[0]=>
array(2) {
["id"]=>
string(1) "1"
["mybool"]=>
string(1) "0"
}
[1]=>
array(2) {
["id"]=>
string(1) "1"
["mybool"]=>
string(1) "0"
}
}
done!
+1 -1
View File
@@ -107,7 +107,7 @@ class MySQLPDOTest extends PDOTest {
// stinky string which we need to parse
$parts = explode('.', $version_string);
if (count($parts) != 3)
if (count($parts) < 3)
return -1;
$version = (int)$parts[0] * 10000;
@@ -1,79 +0,0 @@
--TEST--
MySQL PDO->__construct() - URI
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) != 'WIN') {
die('skip only for Windows');
}
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
?>
--FILE--
<?php
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
try {
if ($tmp = MySQLPDOTest::getTempDir()) {
$file = $tmp . DIRECTORY_SEPARATOR . 'pdomuri.tst';
$dsn = MySQLPDOTest::getDSN();
$user = PDO_MYSQL_TEST_USER;
$pass = PDO_MYSQL_TEST_PASS;
$uri = sprintf('uri:file:%s', $file);
if ($fp = @fopen($file, 'w')) {
// ok, great we can create a file with a DSN in it
fwrite($fp, $dsn);
fclose($fp);
clearstatcache();
assert(file_exists($file));
try {
$db = new PDO($uri, $user, $pass);
} catch (PDOException $e) {
printf("[002] URI=%s, DSN=%s, File=%s (%d bytes, '%s'), %s\n",
$uri, $dsn,
$file, filesize($file), file_get_contents($file),
$e->getMessage());
}
unlink($file);
}
if ($fp = @fopen($file, 'w')) {
fwrite($fp, sprintf('mysql:dbname=letshopeinvalid;%s%s',
chr(0), $dsn));
fclose($fp);
clearstatcache();
assert(file_exists($file));
try {
$db = new PDO($uri, $user, $pass);
} catch (PDOException $e) {
printf("[003] URI=%s, DSN=%s, File=%s (%d bytes, '%s'), chr(0) test, %s\n",
$uri, $dsn,
$file, filesize($file), file_get_contents($file),
$e->getMessage());
}
unlink($file);
}
}
/* TODO: safe mode */
} catch (PDOException $e) {
printf("[001] %s, [%s] %s\n",
$e->getMessage(),
(is_object($db)) ? $db->errorCode() : 'n/a',
(is_object($db)) ? implode(' ', $db->errorInfo()) : 'n/a');
}
print "done!";
?>
--EXPECTF--
Warning: PDO::__construct(file:%spdomuri.tst): failed to open stream: Invalid argument in %s on line %d
[002] URI=uri:file:%spdomuri.tst, DSN=mysql%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql%sdbname=%s'), invalid data source URI
Warning: PDO::__construct(file:%spdomuri.tst): failed to open stream: Invalid argument in %s on line %d
[003] URI=uri:file:%spdomuri.tst, DSN=mysql%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql%sdbname=letshopeinvalid%s'), chr(0) test, invalid data source URI
done!
@@ -2,9 +2,6 @@
MySQL PDO->__construct() - URI
--SKIPIF--
<?php
if (substr(PHP_OS, 0, 3) == 'WIN') {
die('skip not for Windows');
}
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
@@ -21,7 +18,7 @@ MySQLPDOTest::skip();
$dsn = MySQLPDOTest::getDSN();
$user = PDO_MYSQL_TEST_USER;
$pass = PDO_MYSQL_TEST_PASS;
$uri = sprintf('uri:file:%s', $file);
$uri = sprintf('uri:file://%s', (substr(PHP_OS, 0, 3) == 'WIN' ? str_replace('\\', '/', $file) : $file));
if ($fp = @fopen($file, 'w')) {
// ok, great we can create a file with a DSN in it
@@ -49,10 +46,14 @@ MySQLPDOTest::skip();
try {
$db = new PDO($uri, $user, $pass);
} catch (PDOException $e) {
$expected = array(
"SQLSTATE[HY000] [1049] Unknown database 'letshopeinvalid'",
"SQLSTATE[HY000] [2002] No such file or directory"
);
printf("[003] URI=%s, DSN=%s, File=%s (%d bytes, '%s'), chr(0) test, %s\n",
$uri, $dsn,
$file, filesize($file), file_get_contents($file),
$e->getMessage());
(in_array($e->getMessage(), $expected) ? 'EXPECTED ERROR' : $e->getMessage()));
}
unlink($file);
}
@@ -71,9 +72,5 @@ MySQLPDOTest::skip();
print "done!";
?>
--EXPECTF--
Warning: PDO::__construct(file:/tmp/pdomuri.tst): failed to open stream: No such file or directory in %s on line %d
[002] URI=uri:file:%spdomuri.tst, DSN=mysql%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql%sdbname=%s'), invalid data source URI
Warning: PDO::__construct(file:/tmp/pdomuri.tst): failed to open stream: No such file or directory in %s on line %d
[003] URI=uri:file:%spdomuri.tst, DSN=mysql%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql%sdbname=letshopeinvalid%s'), chr(0) test, invalid data source URI
[003] URI=uri:file://%spdomuri.tst, DSN=mysql%sdbname=%s, File=%spdomuri.tst (%d bytes, 'mysql%sdbname=letshopeinvalid%s'), chr(0) test, EXPECTED ERROR
done!
+1 -1
View File
@@ -75,7 +75,7 @@ MySQLPDOTest::skip();
exec_and_count(19, $db, 'CREATE PROCEDURE p(OUT ver_param VARCHAR(255)) BEGIN SELECT VERSION() INTO ver_param; END;', 0);
// we got this far without problems. If there's an issue from now on, its a failure
$ignore_exception = false;
exec_and_count(20, $db, 'CALL p(@version)', 0);
exec_and_count(20, $db, 'CALL p(@version)', 1);
$stmt = $db->query('SELECT @version AS p_version');
$tmp = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (count($tmp) > 1 || !isset($tmp[0]['p_version'])) {
@@ -26,5 +26,5 @@ __HALT_COMPILER();
?>
--EXPECTF--
%s(24) "UnexpectedValueException"
RecursiveDirectoryIterator::__construct(1,1): The system cannot find the file specified. (code: 2)
RecursiveDirectoryIterator::__construct(1,1): %s (code: 2)
===DONE===
+1 -1
View File
@@ -42,7 +42,7 @@ bool(false)
bool(false)
bool(false)
Warning: opendir(foo/hi,foo/hi): The system cannot find the path specified. (code: 3) in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d
Warning: opendir(foo/hi,foo/hi): %s (code: 3) in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d
Warning: opendir(foo/hi): failed to open dir: No such file or directory in phar://%sphar_gobyebye-win32.phar.php/foo/hi on line %d
===DONE===
+1 -10
View File
@@ -7,23 +7,14 @@ Francesco Fullone ff@ideato.it
--SKIPIF--
<?php
if(!extension_loaded("posix")) print "skip - POSIX extension not loaded";
if(!extension_loaded("pcntl")) print "skip - PCNTL extension required";
?>
--FILE--
<?php
echo "*** Test by calling function with pid error ***\n";
$pid = 10000;
posix_kill((2 ** 22) + 1, SIGKILL);
do {
$pid += 1;
$result = shell_exec("ps -p " . $pid);
} while (strstr($pid, $result));
posix_kill($pid, SIGKILL);
var_dump(posix_errno());
?>
--EXPECT--
*** Test by calling function with pid error ***
+1 -1
View File
@@ -3,7 +3,7 @@ Bug #69054 (Null dereference in readline_(read|write)_history() without paramete
--SKIPIF--
<?php if (!extension_loaded("readline") || !function_exists('readline_add_history')) die("skip"); ?>
--INI--
open_basedir=/tmp
open_basedir={TMP}
--FILE--
<?php readline_read_history(); ?>
==DONE==
+20 -20
View File
@@ -4150,21 +4150,10 @@ ZEND_METHOD(reflection_class, getMethod)
/* }}} */
/* {{{ _addmethod */
static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter, zval *obj)
static void _addmethod(zend_function *mptr, zend_class_entry *ce, zval *retval, zend_long filter)
{
zval method;
size_t len = ZSTR_LEN(mptr->common.function_name);
zend_function *closure;
if (mptr->common.fn_flags & filter) {
if (ce == zend_ce_closure && obj && (len == sizeof(ZEND_INVOKE_FUNC_NAME)-1)
&& memcmp(ZSTR_VAL(mptr->common.function_name), ZEND_INVOKE_FUNC_NAME, sizeof(ZEND_INVOKE_FUNC_NAME)-1) == 0
&& (closure = zend_get_closure_invoke_method(Z_OBJ_P(obj))) != NULL)
{
mptr = closure;
}
/* don't assign closure_object since we only reflect the invoke handler
method and not the closure definition itself, even if we have a
closure */
zval method;
reflection_method_factory(ce, mptr, NULL, &method);
add_next_index_zval(retval, &method);
}
@@ -4178,9 +4167,8 @@ static int _addmethod_va(zval *el, int num_args, va_list args, zend_hash_key *ha
zend_class_entry *ce = *va_arg(args, zend_class_entry**);
zval *retval = va_arg(args, zval*);
long filter = va_arg(args, long);
zval *obj = va_arg(args, zval *);
_addmethod(mptr, ce, retval, filter, obj);
_addmethod(mptr, ce, retval, filter);
return ZEND_HASH_APPLY_KEEP;
}
/* }}} */
@@ -4205,12 +4193,24 @@ ZEND_METHOD(reflection_class, getMethods)
GET_REFLECTION_OBJECT_PTR(ce);
array_init(return_value);
zend_hash_apply_with_arguments(&ce->function_table, (apply_func_args_t) _addmethod_va, 4, &ce, return_value, filter, intern->obj);
if (Z_TYPE(intern->obj) != IS_UNDEF && instanceof_function(ce, zend_ce_closure)) {
zend_function *closure = zend_get_closure_invoke_method(Z_OBJ(intern->obj));
zend_hash_apply_with_arguments(&ce->function_table, (apply_func_args_t) _addmethod_va, 4, &ce, return_value, filter);
if (instanceof_function(ce, zend_ce_closure)) {
zend_bool has_obj = Z_TYPE(intern->obj) != IS_UNDEF;
zval obj_tmp;
zend_object *obj;
if (!has_obj) {
object_init_ex(&obj_tmp, ce);
obj = Z_OBJ(obj_tmp);
} else {
obj = Z_OBJ(intern->obj);
}
zend_function *closure = zend_get_closure_invoke_method(obj);
if (closure) {
_addmethod(closure, ce, return_value, filter, &intern->obj);
_free_function(closure);
_addmethod(closure, ce, return_value, filter);
}
if (!has_obj) {
zval_ptr_dtor(&obj_tmp);
}
}
}
+25
View File
@@ -0,0 +1,25 @@
--TEST--
Bug #75186: Inconsistent reflection of Closure:::__invoke()
--FILE--
<?php
$rc = new ReflectionClass(Closure::class);
foreach ($rc->getMethods() as $method) {
if ($method->name == '__invoke') {
var_dump($method);
$method->invoke(
function($what) { echo "Hello $what!\n"; },
"World"
);
}
}
?>
--EXPECTF--
object(ReflectionMethod)#%d (2) {
["name"]=>
string(8) "__invoke"
["class"]=>
string(7) "Closure"
}
Hello World!
+1 -1
View File
@@ -750,7 +750,7 @@ static PHP_INI_MH(OnUpdateSidBits) /* {{{ */
return SUCCESS;
}
php_error_docref(NULL, E_WARNING, "session.configuration 'session.sid_bits' must be between 4 and 6.");
php_error_docref(NULL, E_WARNING, "session.configuration 'session.sid_bits_per_character' must be between 4 and 6.");
return FAILURE;
}
/* }}} */
+4 -4
View File
@@ -6,7 +6,7 @@ Bug #32330 (session_destroy, "Failed to initialize storage module", custom sessi
session.use_trans_sid=0
session.use_cookies=1
session.name=sid
session.save_path=/tmp
session.save_path={TMP}
session.gc_probability=1
session.gc_divisor=1
session.save_handler=files
@@ -69,17 +69,17 @@ $_SESSION['E'] = 'F';
?>
--EXPECTF--
open: path = /tmp, name = sid
open: path = %s, name = sid
read: id = %s
gc: maxlifetime = %d
write: id = %s, data = A|s:1:"B";
close
open: path = /tmp, name = sid
open: path = %s, name = sid
read: id = %s
gc: maxlifetime = %d
destroy: id = %s
close
open: path = /tmp, name = sid
open: path = %s, name = sid
read: id = %s
gc: maxlifetime = %d
write: id = %s, data = E|s:1:"F";
@@ -3,7 +3,7 @@ Test session_set_save_handler() function: create_sid
--INI--
session.save_handler=files
session.name=PHPSESSID
session.save_path=/tmp
session.save_path={TMP}
--SKIPIF--
<?php include('skipif.inc'); ?>
--FILE--
+34 -34
View File
@@ -1,34 +1,34 @@
<?xml encoding='US-ASCII'?>
<!ELEMENT sxe (elem1+, elem11, elem22*)>
<!ATTLIST sxe id CDATA #implied>
<!ELEMENT elem1 elem2*>
<!ATTLIST elem1 attr1 CDATA #required
attr2 CDATA "default>
<!ELEMENT elem2 elem3*>
<!ATTLIST elem2 att25 CDATA #implied
att42 CDATA #implied>
<!ELEMENT elem3 elem4*>
<!ATTLIST elem3>
<!ELEMENT elem4 EMPTY>
<!ATTLIST elem4>
<!ELEMENT elem11 elem111*>
<!ATTLIST elem11>
<!ELEMNET elem111 elem1111*>
<!ATTLIST elem111>
<!ELEMENT elem1111 EMPTY>
<!ATTLIST elem1111>
<!ELEMENT elem22 elem222*>
<!ATTLIST elem22 attr22 CDATA #implied>
<!ELEMENT elem222 EMPTY>
<!ATTLIST elem222>
<?xml encoding='US-ASCII'?>
<!ELEMENT sxe (elem1+, elem11, elem22*)>
<!ATTLIST sxe id CDATA #implied>
<!ELEMENT elem1 elem2*>
<!ATTLIST elem1 attr1 CDATA #required
attr2 CDATA "default>
<!ELEMENT elem2 elem3*>
<!ATTLIST elem2 att25 CDATA #implied
att42 CDATA #implied>
<!ELEMENT elem3 elem4*>
<!ATTLIST elem3>
<!ELEMENT elem4 EMPTY>
<!ATTLIST elem4>
<!ELEMENT elem11 elem111*>
<!ATTLIST elem11>
<!ELEMNET elem111 elem1111*>
<!ATTLIST elem111>
<!ELEMENT elem1111 EMPTY>
<!ATTLIST elem1111>
<!ELEMENT elem22 elem222*>
<!ATTLIST elem22 attr22 CDATA #implied>
<!ELEMENT elem222 EMPTY>
<!ATTLIST elem222>
Loaded 100 of 175 files, more files were not shown because too many files have changed in this diff. Show more