Commit graph

58861 commits

Author SHA1 Message Date
Kamil Tekiela
dbfc9f99d1
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #81037 PDO discards error message text from prepared statement

Closes GH-6978.
2021-05-14 12:04:22 +01:00
Kamil Tekiela
574b551567
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #81037 PDO discards error message text from prepared statement
2021-05-14 11:59:36 +01:00
Kamil Tekiela
6afbb74194
Fixed bug #81037 PDO discards error message text from prepared statement 2021-05-14 11:54:49 +01:00
Christoph M. Becker
3f890635ae
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81032: GD install is affected by external libgd installation
2021-05-14 12:28:36 +02:00
Christoph M. Becker
c455f49a6a
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81032: GD install is affected by external libgd installation
2021-05-14 12:26:40 +02:00
Flavio Heleno
28e7addb9d
Fix #81032: GD install is affected by external libgd installation
This PR replaces the bundled libgd includes from #include <foo.h> with
#include "foo.h" for gd-related headers to avoid including headers that
may be available in system directories instead of the expected local
headers.

Closes GH-6975.
2021-05-14 12:24:45 +02:00
Nikita Popov
840c78b2d8 Check RAND_egd after setting up openssl
Noticed this by accident: We should check functions in the library
only after setting it up.
2021-05-14 12:02:28 +02:00
Björn Tantau
d764f1dc12
Fix #77372: Retain full path of files for directory uploads (#6917)
To fix https://bugs.php.net/bug.php?id=77372 and improve support of `<input type="file" name="files" multiple webkitdirectory>` I introduced another item to the `$_FILES` array called `full_path`, containing the full filename, as supplied by the user-agent.

Co-authored-by: Björn Tantau <bjoern@bjoern-tantau.de>
2021-05-14 11:43:55 +02:00
K
21422e8536
Optimize unpack() for named fields (#6958)
Create name using either zend_init_string_fast (no repetitions) or by concatenating the name with zend_print_ulong_to_buf. This is much more efficient than using snprintf. We also avoid repeated strlen() calculations.
2021-05-14 11:32:46 +02:00
Dmitry Stogov
4522dcb173 JIT/x86: disable register allocation for expected ++/-- overflow case.
This fixes ext/opcache/tests/jit/inc_021.phpt with tracing JIT.
2021-05-14 11:01:54 +03:00
Christoph M. Becker
4030a00e8b
Merge branch 'PHP-8.0'
* PHP-8.0:
  Disable LSan for all PDO_Firebird tests
2021-05-13 23:36:33 +02:00
Christoph M. Becker
b300c6b87f
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Disable LSan for all PDO_Firebird tests
2021-05-13 23:34:37 +02:00
Christoph M. Becker
f6c15e2caf
Disable LSan for all PDO_Firebird tests
The tests leak memory, likely due to a slightly unclean shutdown of
libfbclient.  To avoid failing CI, we disable LSan for all the tests.

Closes GH-6966.
2021-05-13 23:30:17 +02:00
Dmitry Stogov
c94bb37326 Fixed indirect variable access detection when opcache.jit=1252
This fixes `make test TESTS="-d opcache.jit=1252 --repeat 3
Zend/tests/global_with_side_effect_name.phpt"`
2021-05-13 23:01:13 +03:00
George Peter Banyard
96adc806e0
Add -Wstrict-prototypes compiler warning
Disable it for the following extensions:
 - GD
 - pspell
 - readline

Closes GH-5888
2021-05-12 19:02:48 +01:00
George Peter Banyard
ff988a6f4f
Fix remaining [-Wstrict-prototypes] warnings
Two missing void qualifiers for parameter list.
2021-05-12 19:02:48 +01:00
George Peter Banyard
2068d230d9
Fix [-Wstrict-prototypes] warning in PCNTL extension
To achieve this we need to introduce a new wrapper function with
dummy arguments which calls pcntl_signal_dispatch() to respect
the function pointer signature for a tick function.
2021-05-12 19:02:48 +01:00
George Peter Banyard
b7356692f6
Specify function pointer signature for scanf implementation
Fix [-Wstrict-prototypes] warnings in standard/scanf.c
2021-05-12 18:58:44 +01:00
George Peter Banyard
e90180d06a
Use standard function signature instead of K&R in Intrl extension
Drive-by removal of register qualifier.

Fix [-Wstrict-prototypes] warnings in Intl extension.
2021-05-12 18:54:55 +01:00
George Peter Banyard
57a8bf62dd
Use standard function declaration style instead of K&R in libbcmath
Fixes [-Wstrict-prototypes] warnings.
2021-05-12 15:33:55 +01:00
George Peter Banyard
a6a95e3f51
Do not reuse errno as local variable name
errno is a global variable/macro which is implementation defined,
and should not be reused.

This fixes some [-Wstrict-prototypes] warnings.
2021-05-12 15:32:16 +01:00
Dmitry Stogov
2e93bb7a45 Fixed possible use after free 2021-05-12 17:21:39 +03:00
George Peter Banyard
c40231afbf
Mark various functions with void arguments.
This fixes a bunch of [-Wstrict-prototypes] warning,
because in C func() and func(void) have different semantics.
2021-05-12 14:55:53 +01:00
Christoph M. Becker
320d6050e7
Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #44643: bound parameters ignore explicit type definitions
2021-05-12 13:47:57 +02:00
Christoph M. Becker
63c558bcbb
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #44643: bound parameters ignore explicit type definitions
2021-05-12 13:47:01 +02:00
Christoph M. Becker
23a3bbb468
Fix #44643: bound parameters ignore explicit type definitions
If `SQLDescribeParam()` fails for a parameter, we must not assume
`SQL_LONGVARCHAR` for any param which is not `PDO_PARAM_LOB`.  At least
mapping `PDO_PARAM_INT` to `SQL_INTEGER` should be safe, and not
introduce a BC break.

Closes GH-6973.
2021-05-12 13:30:51 +02:00
Mike Pall
16d59a59c8 DynASM: Bump version to 1.5.0. 2021-05-12 13:40:13 +03:00
Mike Pall
5f44ed55c4 DynASM/ARM64: Add .long expr. Add .quad/.addr expr + refs.
Suggested by Dmitry Stogov, Hao Sun and Nick Gasson.
2021-05-12 13:36:32 +03:00
Dmitry Stogov
4a5074154b DynASM/x86: Fix x64 .aword refs. Add .qword, .quad, .addr and .long.
(Switch to .aword implementation by Make Pall)
2021-05-12 13:32:06 +03:00
Dmitry Stogov
e25fce6533 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed JIT on first function execution (opcache.jit=1215) with CALL VM
2021-05-12 12:24:39 +03:00
Dmitry Stogov
e96b984026 Fixed JIT on first function execution (opcache.jit=1215) with CALL VM 2021-05-12 12:24:18 +03:00
Dmitry Stogov
c945c399aa Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed incorrect stack size calculation (sizeof(zval) == 16)
2021-05-12 02:09:14 +03:00
Dmitry Stogov
6fa4493f7b Fixed incorrect stack size calculation (sizeof(zval) == 16) 2021-05-12 02:08:53 +03:00
Dmitry Stogov
9f2389177e Fixed tracing JIT + preloading failures:
ext/opcache/tests/preload_003.phpt
ext/opcache/tests/preload_trait_multiple_fixup.phpt
ext/opcache/tests/preload_trait_static.phpt
2021-05-11 16:50:10 +03:00
Dmitry Stogov
cb0854bc53 JIT class methods only when class entry is completely persistent.
This fixes a number of test failures on low optimization levels.
(e.g. use after free in Zend/tests/bug54268.phpt and tests/classes/protected_001.phpt with opcache.jit=1204)
2021-05-11 15:49:35 +03:00
dwgebler
f5139878f9
Check parameters on compact() and throw warning if not string or array of strings (#6921)
compact() is documented (https://www.php.net/manual/en/function.compact) as a variadic function accepting parameters which are strings or arrays of strings referencing defined symbols.

In actuality, passing nonsense parameters e.g. compact(true, 42) merely returns an empty array. I propose throwing a warning in these cases, to prevent silent bugs.
2021-05-11 09:36:12 +02:00
Máté Kocsis
32aff25ceb
Convert resources to objects in ext/pgsql
Closes GH-6791

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2021-05-11 00:09:30 +02:00
Ayesh Karunaratne
57a635c655 Move resource-object classes of PSpell to \PSpell namespace
[namespaces in bundled extensions](https://wiki.php.net/rfc/namespaces_in_bundled_extensions) changes for PSpell.

 - Rename `PSpell` class to `\PSpell\Dictionary`
 - Rename `PSpellConfig` class to `\PSpell\Config`
 - Add entries to `UPGRADING` file.

Related: bd12c94f
2021-05-10 19:29:54 +02:00
Michael Voříšek
3ccc0409ce Remove no longer used "log_errors_max_len" ini directive (#6838)
This is a re-application of the original match against master.
The patch was originally applied to master, then reverted from
there, incorrectly applied to PHP-8.0, reverted from there due
to ABI break, and now lands on master again. We can only hope
that it does not get reverted again ;)
2021-05-10 19:26:33 +02:00
Nikita Popov
4f46bec5d4 Initialize zpp varargs variables
These are not initialized if no args are passed.
2021-05-10 19:19:26 +02:00
Nikita Popov
a9695aa155 Merge branch 'PHP-8.0'
* PHP-8.0:
  Correct the argument names for ext/sodium functions
2021-05-10 17:22:41 +02:00
Paragon Initiative Enterprises
0c57ebb116 Correct the argument names for ext/sodium functions
Closes GH-6969.
2021-05-10 17:22:02 +02:00
Aaron Piotrowski
39fa55a4c9
Switch register_tick_function back to zend_parse_parameters
No reason to use fast ZPP in register_tick_function, so let’s keep the binary size down just a bit.
2021-05-10 10:17:29 -05:00
George Peter Banyard
a9695cc615
Refactor register shutdown function mechanism
Use FCI/FCC structure instead of custom implementation which does the same.
This also fixes the "bug" which prevented static methods from being shutdown functions.

Closes GH-5829

Co-authored-by: Aaron Piotrowski <aaron@trowski.com>
2021-05-10 15:54:59 +01:00
Máté Kocsis
fcd18757b2
Add reproducer for possible issue with object return type inheritance (#6961)
Fix early inheritance

Co-authored-by: Joe Watkins <krakjoe@php.net>
2021-05-10 12:52:59 +02:00
Ayesh Karunaratne
e0b947a8da
Move resource-object classes of LDAP to \LDAP namespaces (#6963)
Another change as per accepted [namespaces in bundled extensions RFC](https://wiki.php.net/rfc/namespaces_in_bundled_extensions).

Related: #6925, #5945, #6960
2021-05-09 22:20:21 +02:00
Aaron Piotrowski
66bfad57de
Remove unnecessay NULL
Z_PARAM_FUNC already sets params to NULL.
2021-05-09 14:55:05 -05:00
Aaron Piotrowski
0189585c9e
Fix tick function with arguments
Tick function arguments need to be copied to fci params.
2021-05-09 14:08:20 -05:00
Aaron Piotrowski
7ec048f96d
Do not free tick function entry
This memory is freed by zend_llist.
2021-05-09 11:44:32 -05:00
Nikita Popov
090627048c Revert "Remove no longer used "log_errors_max_len" ini directive (#6838)"
This reverts commit d2d227e547.

This is an ABI break.
2021-05-08 20:54:53 +02:00