1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 02:33:17 +02:00
Commit Graph

125622 Commits

Author SHA1 Message Date
Alex Dowad ae71bfdee7 Add more tests for UCS-4 text conversion 2021-09-06 13:16:23 +02:00
Alex Dowad fd0e0c7390 Add another test for UCS-2 text conversion 2021-09-06 13:16:23 +02:00
Alex Dowad edf2bd95d9 Add more tests for ISO-2022-JP and JIS7/8 text conversion 2021-09-06 13:16:23 +02:00
Alex Dowad 6a2dca3420 Add more tests for ISO-2022-JP-KDDI text conversion 2021-09-06 13:16:23 +02:00
Alex Dowad d2f5a8b328 Add more tests for SJIS-mac text conversion 2021-09-06 13:16:23 +02:00
Alex Dowad 0957f54eb1 Treat truncated escape sequences for CP5022{0,1,2} as error 2021-09-06 13:16:23 +02:00
Alex Dowad 64e379d81e Declare CP50222 flush function as 'static' 2021-09-06 13:16:23 +02:00
Alex Dowad a312620607 Remove redundant NULL checks in mbstring
Whoever originally wrote mbstring seems to have a deathly fear of NULL
pointers lurking behind every corner. A common pattern is that one
function will check if a pointer is NULL, then pass it to another
function, which will again check if it is NULL, then pass to yet another
function, which will yet again check if it is NULL... it's NULL checks
all the way down.

Remove all the NULL checks in places where pointers could not possibly
be NULL.
2021-09-06 13:16:23 +02:00
Alex Dowad 626f0fec54 Remove some dead code from mbstring
mbstring has a great deal of dead code. Some common types are:

- Default switch clauses which will never be taken
- If clauses intended to convert codepoints which were not present in
  a conversion table... but the codepoint in question *is* in the table,
  so the if clause is not needed.
- Bounds checks in places where it is not possible for a value to ever
  be out of bounds.
- Checks to see if an unmatched Unicode codepoint is in CP932 extension
  range 3... but every codepoint in range 3 is also in range 2, so no
  codepoint will ever be matched and converted by that code.
2021-09-06 13:16:23 +02:00
Máté Kocsis d824eaee33 Merge branch 'PHP-8.1'
* PHP-8.1:
  Add more specific array return type hints for various extensions - part 3
2021-09-06 12:27:57 +02:00
Máté Kocsis 6a47831e6e Add more specific array return type hints for various extensions - part 3 (#7467) 2021-09-06 12:27:28 +02:00
Nikita Popov 99510ed009 Remove unnecessary argument from zend_throw_auto_init_*
This is now always "array", so inline it.
2021-09-06 11:46:20 +02:00
Máté Kocsis 26354488b6 Merge branch 'PHP-8.1'
* PHP-8.0:
  Fix the return type of ftp_raw()
2021-09-06 10:30:12 +02:00
Máté Kocsis a55c6384dc Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix the return type of ftp_raw()
2021-09-06 10:29:24 +02:00
Máté Kocsis 4b3206d6c1 Fix the return type of ftp_raw() (#7466) 2021-09-06 10:26:01 +02:00
Máté Kocsis 47f430dbdb Merge branch 'PHP-8.1' 2021-09-04 17:59:21 +02:00
Máté Kocsis d670d9335c Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix default value of $flags in idn_to_ascii() and idn_to_utf8()
2021-09-04 17:57:23 +02:00
Máté Kocsis d5aed7b0e3 Fix default value of $flags in idn_to_ascii() and idn_to_utf8() 2021-09-04 16:42:28 +02:00
Derick Rethans d7edb808e9 Merge branch 'PHP-8.1' 2021-09-03 18:21:21 +01:00
Derick Rethans a6d50d21d9 Fixed typo 2021-09-03 18:21:10 +01:00
Tyson Andre 4c48fd22d7 Fix inconsistency in true/false/null constant resolution when opcache is not used (#7441)
Strangely, uses of eval and 'php -a' (or loading a file without opcache after a namespaced constant was declared)
will not treat non-FQ true/false/null as magic keywords, while compiled php required from a file would do that.

This may confuse people learning the language, and result in code loaded with
eval() behaving differently from the same snippet in a file loaded by require.

```
Interactive shell

php > define('foo\true', 'test');
php > namespace foo { var_dump(true); }
string(4) "test"
```

This will make the same session instead properly emit `bool(true);` like it
already would if running those statements in files when opcache was used.
2021-09-03 08:42:36 -04:00
Nikita Popov 218fd03532 Fix some more CLEANUP sections 2021-09-03 14:10:40 +02:00
Nikita Popov 481cdeab31 Fix file clash in gd tests 2021-09-03 13:59:13 +02:00
Nikita Popov 1def88d0e3 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fully qualify ReturnTypeWillChange in deprecation message
2021-09-03 13:57:29 +02:00
Nikita Popov 3eeeeeb104 Fully qualify ReturnTypeWillChange in deprecation message
When adding the #[ReturnTypeWillChange] attribute in namespaced
code, you also need to use ReturnTypeWillChange, otherwise it
will be silently ignored and may result in confusion. Change the
deprecation message to suggest #[\ReturnTypeWillChange], which
will always work.

Closes GH-7454.
2021-09-03 13:57:23 +02:00
Nikita Popov 5cb6f467c4 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fully qualify ReturnTypeWillChange in deprecation message
2021-09-03 13:56:08 +02:00
Nikita Popov 6cc928c734 Fully qualify ReturnTypeWillChange in deprecation message
When adding the #[ReturnTypeWillChange] attribute in namespaced
code, you also need to use ReturnTypeWillChange, otherwise it
will be silently ignored and may result in confusion. Change the
deprecation message to suggest #[\ReturnTypeWillChange], which
will always work.

Closes GH-7454.
2021-09-03 13:55:20 +02:00
Nikita Popov 98d004c9bc Fix CLEAN sections 2021-09-03 12:36:02 +02:00
codinghuang 3021ce6e58 Clean ext/opcache/minilua 2021-09-03 12:22:23 +02:00
Nikita Popov 7a411564f0 Fix some more CLEAN sections 2021-09-03 11:18:19 +02:00
Nikita Popov 2ab4482d34 Fix some broken or unnecessary CLEAN sections 2021-09-03 10:52:30 +02:00
Kamil Tekiela 400c6055b1 Remove mysqli_close that prevented CLEAN from running properly 2021-09-03 10:43:10 +02:00
twosee e16af8e84d Support generate lldb command in run-tests.php (#7451) 2021-09-03 09:38:07 +08:00
twosee 0ac60d6055 Micro optimizations for xp_ssl.c (#7447)
If certfile/private_key points to a file that doesn't exist, it throw a warning and return failure now.
Also fixed sni_server tests.

Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
2021-09-03 09:37:42 +08:00
Christoph M. Becker abe05b1854 Merge branch 'PHP-8.1'
* PHP-8.1:
  Use --EXTENSIONS-- section for new test
2021-09-02 23:49:24 +02:00
Christoph M. Becker cb5a4ed920 Use --EXTENSIONS-- section for new test 2021-09-02 23:49:05 +02:00
Christoph M. Becker 7c2381e5ee Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #81407: shmop_open won't attach and causes php to crash
2021-09-02 23:21:39 +02:00
Christoph M. Becker 404bed1a69 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81407: shmop_open won't attach and causes php to crash
2021-09-02 23:21:22 +02:00
Christoph M. Becker 58ad403cec Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81407: shmop_open won't attach and causes php to crash
2021-09-02 23:18:53 +02:00
Christoph M. Becker f3d24af74f Fix #81407: shmop_open won't attach and causes php to crash
We need to allocate buffers for the file mapping names which are large
enough for all potential keys (`key_t` is defined as `int` on Windows).

Regarding the test: it's probably never a good idea to use hard-coded
keys (should always use `ftok()` instead), but to reliably reproduce
this Windows specific issue we need to, and it shouldn't be an issue on
that OS.

Closes GH-7448.
2021-09-02 23:16:48 +02:00
Máté Kocsis 1d3365f98f Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix forgotten test
2021-09-02 17:45:12 +02:00
Máté Kocsis 805f2b9803 Fix forgotten test 2021-09-02 17:44:52 +02:00
Máté Kocsis bc7f0b3c4f Merge branch 'PHP-8.1'
PHP-8.1:
  * Revert unintended tentative return type change
2021-09-02 17:06:35 +02:00
Máté Kocsis 194f1f095f Revert unintended tentative return type change
I accidentally made the return type of all Reflection*::getAttributes() methods tentative, even though they have already been declared natively.
2021-09-02 17:06:19 +02:00
Máté Kocsis b6ecdd4a02 Merge branch 'PHP-8.1'
* PHP-8.1:
  Properly escape the default value of string properties and enum cases
2021-09-02 16:53:46 +02:00
Máté Kocsis 4483ecf5a9 Properly escape the default value of string properties and enum cases 2021-09-02 16:53:31 +02:00
Nikita Popov 2ffa70b97c Slightly clean up is_callable implementation
And adjust an error message to line up with the error message
used for $callable() in zend_execute.c.
2021-09-02 10:37:13 +02:00
Dmitry Stogov f3c5d1a568 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed bug #81409 (Incorrect JIT code for ADD with a reference to array)
  Preparing for 8.1.0RC2
2021-09-02 11:17:32 +03:00
Dmitry Stogov cbc925e510 Fixed bug #81409 (Incorrect JIT code for ADD with a reference to array) 2021-09-02 11:13:27 +03:00
Patrick Allaert d6d6491153 Preparing for 8.1.0RC2 2021-09-01 18:22:32 +02:00