1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 16:38:25 +02:00
Commit Graph

60049 Commits

Author SHA1 Message Date
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
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
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 98d004c9bc Fix CLEAN sections 2021-09-03 12:36:02 +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 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 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
Dmitry Stogov 3d7a7dc276 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed call to zend_free_compiled_variables()
2021-09-01 19:11:31 +03:00
Dmitry Stogov 66f8866a62 JIT: Fixed call to zend_free_compiled_variables() 2021-09-01 19:10:54 +03:00
Nikita Popov 6b8d4151cf Remove leftover zval_ptr_dtor
This should have been dropped as part of
a8254ed576.
2021-09-01 16:59:35 +02:00
Nikita Popov 00f7b0d6e7 Don't unnecessary fetch error in is_callable()
As we just end up freeing it afterwards, avoid populating it in
the first place.
2021-09-01 16:58:46 +02:00
Nikita Popov e41f7e5989 Simplify handler invocation in xsltprocessor 2021-09-01 16:40:50 +02:00
Nikita Popov a8254ed576 Simplify unserialize_callback_func handling 2021-09-01 16:33:22 +02:00
Nikita Popov 485d3acfe6 Make zend_call_function() failure handling consistent
This API had rather peculiar behavior in case the provided function
is not callable. For some types of failures, it would silently
return FAILURE (e.g. a function does not exist), while for others
(e.g. a class does not exist) it would generate a warning. Depending
on what the calling code does, this can either result in silent
failure or duplicate errors.

This commit switches the contract such that zend_call_function()
always (*) succeeds, though that success might be in the form of
throwing an exception. Calling a non-callable will now consistently
throw an exception.

There are some rare callers that do want to ignore missing methods,
for legacy APIs that are specific with optional methods. For these
use cases a new zend_call_method_if_exists() API is provided.

Calling code generally does not need to explicitly check for and
report zend_call_function() failures -- it can rely on
zend_call_function() having already done so. However, existing
code that does check for failure should continue to work fine.

(*) The only exception to this is if EG(active) being false during
late engine shutdown. This is not relevant to most code, but code
running in destructors and similar may need to be aware of the
possibility.
2021-09-01 16:09:23 +02:00
Remi Collet 0b743d5d95 Merge branch 'PHP-8.1'
* PHP-8.1:
  NEWS
  NEWS + bump zip version
  Fix #80833 ZipArchive::getStream doesn't use setPassword
2021-09-01 15:52:26 +02:00
Remi Collet d515979b34 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  NEWS + bump zip version
  Fix #80833 ZipArchive::getStream doesn't use setPassword
2021-09-01 15:51:37 +02:00
Remi Collet fde24e4db0 NEWS + bump zip version 2021-09-01 15:51:24 +02:00
Remi Collet a6ffd8d1e9 Fix #80833 ZipArchive::getStream doesn't use setPassword 2021-09-01 15:49:46 +02:00
Nikita Popov bf9b774327 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix bug #81405: Restore old PDO::PARAM_* values
2021-09-01 13:55:35 +02:00
Nikita Popov 1e012ecb3f Fix bug #81405: Restore old PDO::PARAM_* values
Doctrine hardcodes the values of these constants, avoid changing
them.

Closes GH-7445.
2021-09-01 13:54:41 +02:00
Nikita Popov 99d3771653 Fix check in user filter dtor
obj is always non-null, we need to check for UNDEF here.

This was caught by the new assertion introduced in
3ec14000c6.
2021-09-01 12:50:01 +02:00
twosee aa893c4a71 Simplify SSL_set_mode() calls (#7444)
SSL_set_mode() adds the mode set via bitmask in mode to ssl.
2021-09-01 16:33:19 +08:00
twosee a13730c5e4 Simplify zend_forbid_dynamic_call() (#7443)
The special cases (parse_str/mb_parse_str with a single argument) have been removed completely, we can simplify it now.
2021-09-01 16:32:05 +08:00
Derick Rethans b0dd55b11c Fixed test - the expected result was wrong 2021-08-31 17:19:28 +01:00
Nikita Popov 5adfcfe746 Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid dangling pointer in curl header.str
2021-08-31 17:25:38 +02:00
Nikita Popov db055fdb89 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Avoid dangling pointer in curl header.str
2021-08-31 17:24:30 +02:00
Alexey Zamorov 8c292a2f9d Avoid dangling pointer in curl header.str
If buf_len is zero, this would leave behind a dangling pointer
to an already released header.str. Make sure this can't happen
by always overwriting the pointer.

Closes GH-7376.
2021-08-31 17:23:58 +02:00
Nikita Popov 4ba7e5b24d Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix curl_copy_handle() with CURLINFO_HEADER_OUT
2021-08-31 17:09:34 +02:00