1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00
Commit Graph

120222 Commits

Author SHA1 Message Date
Máté Kocsis cc35cfd2eb Promote warnings to exceptions in ext/filter
Closes GH-5970
2020-08-24 17:34:32 +02:00
Nikita Popov c557c410af Drop a spurious zend_string_release
This should have been dropped in the refactoring.
2020-08-24 17:30:31 +02:00
Nikita Popov 9feb98859f Clean up setlocale implementation
Factor out the core logic into a separate function and drop the
"clever" code that combines iteration through variadic arguments
and arrays.

This fixes bug #79829 as a side effect.
2020-08-24 17:09:33 +02:00
Nikita Popov 8c3574bd6c Remove php_my_setlocale workaround
This works around a macro-expansion issue that is no longer
relevant in PHP 8.
2020-08-24 16:50:03 +02:00
Nikita Popov 7a6ae9b148 Fix refcounting for the named params case as well
Adjust the test case to pass a refcounted value and to also check
the named params case.
2020-08-24 16:30:49 +02:00
Nikita Popov 779e904465 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix refcounting
2020-08-24 16:23:33 +02:00
Nikita Popov bb54694f4f Fix refcounting 2020-08-24 16:23:19 +02:00
Tyson Andre e056e2dae9 Check for duplicate names in gen_stub.php
With named arguments in php 8.0, it's important that php's modules
or PECL extensions using gen_stub.php don't generate functions
with duplicate names.

Warn if a parameter name is repeated,
even if the last occurrence is a variadic parameter

Closes GH-6035
2020-08-24 09:31:46 -04:00
Christoph M. Becker 5643f34a1e Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #79979: passing value to by-ref param via CUFA crashes
2020-08-24 15:03:26 +02:00
Christoph M. Becker 6b6c2c003c Fix #79979: passing value to by-ref param via CUFA crashes
If a by-val send is not allowed, we must not do so.  Instead we wrap
the value in a temporary reference.

Closes GH-6000
2020-08-24 14:08:32 +02:00
Berbe bfeb2f6abc Fix: Gracefully handle empty user input in run-tests.php
Closes GH-6016.
2020-08-24 11:46:01 +02:00
David Carlier 32c6a0bbbb further network libraries detection for Haiku system.
Closes GH-5997.
2020-08-24 11:37:48 +02:00
Christoph M. Becker c925028d49 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #79986: str_ireplace bug with diacritics characters
2020-08-24 11:10:09 +02:00
Christoph M. Becker 5ab7b30cd6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79986: str_ireplace bug with diacritics characters
2020-08-24 11:09:38 +02:00
Christoph M. Becker 844a2dd6ac Fix #79986: str_ireplace bug with diacritics characters
`tolower()` returns an `int`, so we must not convert to `char` which
may be `signed` and as such may be subject to overflow (actually,
implementation defined behavior).

Closes GH-6007
2020-08-24 11:08:48 +02:00
Christoph M. Becker 08d2e511e4 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80002: calc free space for new interned string is wrong
2020-08-24 11:04:27 +02:00
Christoph M. Becker 10df94dd0e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80002: calc free space for new interned string is wrong
2020-08-24 11:04:03 +02:00
Christoph M. Becker fcd26ffcc3 Fix #80002: calc free space for new interned string is wrong
We need to calculate the free size in bytes.

Patch contributed by t-matsuno.

Closes GH-6024
2020-08-24 11:03:19 +02:00
Nikita Popov 9395e01e3d Check variadic parameter for type and duplicate name
Set HAS_TYPE_HINTS flag if the variadic parameter is types as well,
and make sure it has a distinct name. This was previously missed,
because the variadic parameter is not part of num_args.
2020-08-24 10:15:57 +02:00
Kees Cook 2c2bb50984 sapi/fpm/config.m4: check for libapparmor's aa_change_profile()
The fpm code actually uses aa_change_profile(), not change_hat(). Test
for the correct function. (libapparmor always has both, so this is just
a correctness fix.)

Closes GH-6037.
2020-08-24 10:10:12 +02:00
Dmitry Stogov 5c18ee58b9 Fixed use-after-free introduced by aed1f78515 2020-08-24 09:50:54 +03:00
Máté Kocsis 118406a31c Remove custom hacks from gen_stub.php after PHP-Parser upgrade 2020-08-23 21:17:05 +02:00
Tyson Andre 4bba59d491 Update PHP-Parser from 4.3.0 to 4.9.0
PHP-Parser 4.3.0 failed to recognize that the `match` keyword could be
used as a class constant name.
4.9.0 also adds support for keywords in namespaced names.
See https://github.com/nikic/PHP-Parser/releases

So forcing regeneration of spl_iterators.stub.php failed.

PECL extensions using gen_stub.php would also be affected
by the same issue.

```
ext/spl/spl_iterators.stub.php
    public function __construct(Iterator $iterator, string $regex,
    int $mode = self::MATCH, int $flags = 0, int $preg_flags = 0) {}
```

Testing: I successfully regenerated stubs by setting forceRegeneration to true
and running `touch **/*.stub.php; make`.
The stubs did not change, as expected.

Closes GH-6036
2020-08-23 11:51:57 -04:00
Christoph M. Becker e6044d4455 Fix #55847: DOTNET .NET 4.0 GAC new location
If we do not specify the exact version of the .NET framework to use,
the default CLR is loaded, which is typically CLR 2, which is very old.
Therefore, we introduce a `PHP_INI_SYSTEM` setting, which allows users
to choose the desired .NET framework version.  The value of the setting
are the first three parts of the framework's version number, separated
by dots, and prefixed with "v", e.g. "v4.0.30319".  If the value of the
INI setting is `NULL` (the default) or an empty string, the default CLR
is used.

Internally, we switch from the most generic `CoCreateInstance()` to
`CorBindToRuntime()` which is implemented in mscoree.dll.  To avoid the
hard dependency to that library, we load dynamically.

So this fix is supposed to be fully backwards compatible.

Closes GH-5949
2020-08-22 12:42:34 +02:00
Christoph M. Becker 969a432fd8 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80007: Potential type confusion in unixtojd() parameter parsing
2020-08-22 12:34:24 +02:00
Christoph M. Becker 81fffa86b2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80007: Potential type confusion in unixtojd() parameter parsing
2020-08-22 12:31:07 +02:00
Andy Postnikov b2a33ab06b Fix #80007: Potential type confusion in unixtojd() parameter parsing
Also it fixes test on 32-bit armv7 and x86
- Test unixtojd() function : error conditions [ext/calendar/tests/unixtojd_error1.phpt]

Closes GH-6033
2020-08-22 12:30:04 +02:00
Christopher Jones 47c787ff5b Squash a Linux compile warning 2020-08-22 11:37:23 +10:00
David Carlier f32653accc fileinfo build fix proposal for haiku.
Haiku already defines a unichar type and different than the fileinfo's anyway.

Closed GH-5983
2020-08-21 16:13:09 +02:00
Christoph M. Becker 3c5412fc8f Merge branch 'PHP-7.4' into master
* PHP-7.4:
  sqlite3 linkage issue on some systems/package combination fix.
2020-08-21 15:46:30 +02:00
David Carlier 1b21b56074 sqlite3 linkage issue on some systems/package combination fix.
Checking the version is not enough, the function might be available
but the symbols are not present still.

Closes GH-5993
2020-08-21 15:45:51 +02:00
Christoph M. Becker 13419befff Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix wrong datatype
2020-08-21 15:30:07 +02:00
Christoph M. Becker 8f9f308bb9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix wrong datatype
2020-08-21 15:28:37 +02:00
Manuel Mausz 46d62e5464 Fix wrong datatype
ini_entry->modifiable is of type uint8_t and so should be the temp. variable. Especially important after 4b77a158.

Closes GH-6028
2020-08-21 15:28:12 +02:00
Remi Collet 8c57474e35 ensure installed ini don't interfere 2020-08-21 14:41:35 +02:00
Christopher Jones ff66e4945e OCI8 classes were already renamed in 8; this now follows the new-new standard 2020-08-21 17:46:16 +10:00
Dmitry Stogov 8095a0ef7f Better register usage for ASSIGN_DIM_OP 2020-08-21 09:50:28 +03:00
Dmitry Stogov 35a3e450bc Better registers usage 2020-08-21 01:57:03 +03:00
Dmitry Stogov c64cb19138 cleanup unused parameters 2020-08-20 20:43:40 +03:00
Dmitry Stogov dd29a6e79e efree() doesn't use line number arguments (pass zeros) 2020-08-20 20:39:13 +03:00
Dmitry Stogov aed1f78515 micro-optimization 2020-08-20 15:02:12 +03:00
Máté Kocsis 4e6fbb0a12 Promote warnings to exceptions in ext/gd
Closes GH-6023
2020-08-20 12:07:04 +02:00
Dmitry Stogov 22982eee33 Load zval type into register to eliminate double load 2020-08-19 17:51:23 +03:00
Dmitry Stogov bcadf9da8a Shrink live intervals of IS_VAR/IS_TMP_VAR 2020-08-19 14:53:01 +03:00
Dmitry Stogov c6c1682d7a Fixed tracing JIT crash in case SSA for op_array is not provided 2020-08-19 14:51:39 +03:00
Benjamin Eberlei a34fd4d590 Update NEWS w.r.t to bugfix #79968 2020-08-19 12:20:11 +02:00
Benjamin Eberlei 9f6820f7f1 Fix #79968: Manipulation on unattached DOMChildNode should throw DOMException 2020-08-19 11:54:41 +02:00
Dmitry Stogov 736c5dca10 Fixed memory leak (ext/hash/tests/mhash_001.phpt failure) 2020-08-19 09:30:08 +03:00
Tyson Andre 9883fec99f Fix more basic function stubs
User-defined functions can't have multiple parameters with the same name.
Don't do that for var_dump/debug_zval_dump.

Consistently use array $array to match docs

Fix typo in UPGRADING

Fixes GH-6015
2020-08-18 20:23:42 -04:00
Dmitry Stogov f559c78000 Check for exception after $this destruction 2020-08-18 21:13:18 +03:00