1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

276 Commits

Author SHA1 Message Date
Alexandre Daubois
49e3956b70 core: Deprecate using null as an array offset and when calling array_key_exists() (#19511)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_using_values_null_as_an_array_offset_and_when_calling_array_key_exists
2025-09-04 22:12:24 +01:00
Tim Düsterhus
b27d91993d main: Change the register_argc_argv INI default to Off (#19473)
This partly implements the deprecation of the `register_argc_argv` INI setting
by updating the default value to ensure safe behavior when no INI file is
loaded. The actual deprecation warning will follow separately.

RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_register_argc_argv_ini_directive
2025-08-28 17:39:55 +02:00
Alexandre Daubois
a84a82ed88 Deprecate disabling report_memleaks INI directive (#19481)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_report_memleaks_ini_directive
2025-08-16 14:04:34 +02:00
Gina Peter Banyard
94a15cc92f Deprecate the parameter of get_defined_functions() (#19425)
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_the_exclude_disabled_parameter_of_get_defined_functions
2025-08-09 11:22:43 +01:00
Ilija Tovilo
cd80ed6f7b Implement changes to GH-17951 according to ML discussion 2025-08-04 16:04:25 +02:00
Frederik Milling Pytlick
4e21924271 Fix GH-17951: Addition of max_memory_limit INI
Closes GH-18011
2025-08-04 16:04:25 +02:00
Shivam Mathur
9adc94985f Merge branch 'PHP-8.4' 2025-06-25 03:23:03 +05:30
Shivam Mathur
a8bd3ba1bb Merge branch 'PHP-8.3' into PHP-8.4 2025-06-25 03:22:43 +05:30
Shivam Mathur
ac15486ae0 Fix CI for windows-2022
This is a continuation of GH-18927 to fix CI for windows-2022
2025-06-25 03:20:49 +05:30
Christoph M. Becker
bef96f35fd Merge branch 'PHP-8.4'
* PHP-8.4:
  Revert "Enable GHSA-9pqp-7h25-4f32.phpt on Windows"
2024-12-04 20:47:48 +01:00
Christoph M. Becker
88acd91683 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Revert "Enable GHSA-9pqp-7h25-4f32.phpt on Windows"
2024-12-04 20:47:11 +01:00
Christoph M. Becker
e50cf7a7a0 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Revert "Enable GHSA-9pqp-7h25-4f32.phpt on Windows"
2024-12-04 20:45:39 +01:00
Christoph M. Becker
e532d9afb5 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Revert "Enable GHSA-9pqp-7h25-4f32.phpt on Windows"
2024-12-04 20:44:47 +01:00
Christoph M. Becker
2285d7083e Revert "Enable GHSA-9pqp-7h25-4f32.phpt on Windows"
This reverts commit 7685fb0e1c.

The test fails at least for PHP-8.2+ on CI. Needs closer investigation.
2024-12-04 20:43:49 +01:00
Christoph M. Becker
44e4f6d8f9 Merge branch 'PHP-8.4'
* PHP-8.4:
  Enable GHSA-9pqp-7h25-4f32.phpt on Windows
2024-12-04 19:06:20 +01:00
Christoph M. Becker
fbba6df626 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Enable GHSA-9pqp-7h25-4f32.phpt on Windows
2024-12-04 19:05:49 +01:00
Christoph M. Becker
9c40bdaaf5 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Enable GHSA-9pqp-7h25-4f32.phpt on Windows
2024-12-04 19:04:52 +01:00
Christoph M. Becker
c17b5bae8a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Enable GHSA-9pqp-7h25-4f32.phpt on Windows
2024-12-04 19:04:22 +01:00
Christoph M. Becker
7685fb0e1c Enable GHSA-9pqp-7h25-4f32.phpt on Windows
Closes GH-16933.
2024-12-04 19:03:42 +01:00
Niels Dossche
51aee3877b Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-16998: UBSAN warning in rfc1867
2024-12-01 11:00:23 +01:00
Niels Dossche
c06a1a44f7 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-16998: UBSAN warning in rfc1867
2024-12-01 11:00:17 +01:00
Niels Dossche
4eaa6f9d4e Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16998: UBSAN warning in rfc1867
2024-12-01 10:59:59 +01:00
Niels Dossche
aab784263d Fix GH-16998: UBSAN warning in rfc1867
The "else branch" of `next_line` can reset the `buf_begin` field to
NULL, causing the next invocation to pass NULL to `memchr` with a 0
length. When UBSAN is enabled this causes an UBSAN abort. Real world
impact is likely none because of the 0 length.

To fix this, don't set the pointer to NULL, which means that the
`memchr` will return NULL and since
`self->bytes_in_buffer < self->bufsize` we return NULL and request more
data through `fill_buffer`. That function will reset `buf_begin` and
`bytes_in_buffer` so that the next invocation works fine.

I chose this solution so we have an invariant that `buf_begin` is never
NULL, which makes reasoning easier. An alternative solution is keeping
the NULLing of `buf_begin` and add an extra check at the top of
`next_line`, but I didn't like special casing this.

Closes GH-17000.
2024-12-01 10:59:30 +01:00
Christoph M. Becker
2834f47031 Fix test expectation for single digit days
See <https://github.com/php/php-src/pull/16747#pullrequestreview-2444293792>.

Co-authored-by: Ayesh Karunaratne <ayesh@aye.sh>
2024-11-19 12:28:32 +01:00
Christoph M. Becker
6dec6a6dba Add PHP_BUILD_DATE constant
This information can be occasionally useful, and would otherwise need
to be parsed from `phpinfo()` output.

However, maybe more importantly we unify the build date between what is
given by `php -v` and `php -i`, since these compilation units are not
necessarily preprocessed within the same second.

Closes GH-16747.
2024-11-18 20:53:28 +01:00
Ben Ramsey
d854a54b5f Merge branch 'PHP-8.3' into PHP-8.4 2024-09-26 14:24:13 -05:00
Ben Ramsey
6d99ccc268 Merge branch 'PHP-8.2' into PHP-8.3 2024-09-26 14:13:00 -05:00
Ben Ramsey
c259c9f3f6 Merge branch 'PHP-8.1' into PHP-8.2 2024-09-26 13:13:46 -05:00
Christoph M. Becker
05fce50f94 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-15905: Assertion failure for TRACK_VARS_SERVER
2024-09-26 15:35:42 +02:00
Christoph M. Becker
bf8c01db7f Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15905: Assertion failure for TRACK_VARS_SERVER
2024-09-26 15:34:34 +02:00
Christoph M. Becker
87d59d7fdd Fix GH-15905: Assertion failure for TRACK_VARS_SERVER
When the superglobals are eagerly initialized, but "S" is not contained
in `variables_order`, `TRACK_VARS_SERVER` is created as empty array
with refcount > 1.  Since this hash table may later be modified, a flag
is set which allows such COW violations for assertions.  However, when
`register_argc_argv` is on, the so far uninitialized hash table is
updated with `argv`, what causes the hash table to be initialized, what
drops the allow-COW-violations flag.  The following update with `argc`
then triggers a refcount violation assertion.

Since we consider `HT_ALLOW_COW_VIOLATION` a hack, we do not want to
keep the flag during hash table initialization, so we initialize the
hash table right away after creation for this code path.

Closes GH-15930.
2024-09-26 15:33:35 +02:00
Jakub Zelenka
4bcc7d5778 Skip GHSA-9pqp-7h25-4f32 test on Windows 2024-09-23 18:54:31 +01:00
Arnaud Le Blanc
d65a1e6f91 Fix GHSA-9pqp-7h25-4f32
multipart/form-data boundaries larger than the read buffer result in erroneous
parsing, which violates data integrity.

Limit boundary size, as allowed by RFC 1521:

    Encapsulation boundaries [...] must be no longer than 70 characters, not
    counting the two leading hyphens.

We correctly parse payloads with boundaries of length up to
FILLUNIT-strlen("\r\n--") bytes, so allow this for BC.
2024-09-23 11:23:13 +01:00
Peter Kokot
c44834d8ad Trim trailing whitespace (#14721) 2024-06-29 18:41:45 +02:00
Ilija Tovilo
cd66fcc68b Add request_parse_body() function
RFC: https://wiki.php.net/rfc/rfc1867-non-post

This function allows populating the $_POST and $_FILES globals for non-post
requests. This avoids manual parsing of RFC1867 requests.

Fixes #55815
Closes GH-11472
2024-02-08 12:08:07 +01:00
Niels Dossche
dcc3255b18 Fix GH-10489: run-tests.php does not escape path when building cmd (#10560)
Multiple tests had to be changed to escape the arguments in shell
commands. Some tests are skipped because they behave differently with
spaces in the path versus without. One notable example of this is the
hashbang test which does not work because spaces in hashbangs paths are
not supported in Linux.

Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
2023-02-25 14:02:06 +00:00
Michael Voříšek
60189aa96a Skip locale tests /w musl libc (#9141) 2022-07-25 23:56:14 +01:00
Eric Norris
09237f6126 Update request startup error messages 2022-07-18 23:19:59 +01:00
Jakub Zelenka
922371f3b1 Do not send X-Powered-By if headers sent (#9039)
Co-authored-by: Eric Norris <erictnorris@gmail.com>
2022-07-18 18:01:05 +01:00
Mikhail Galanin
ffdf25a270 Add "error_log_mode" setting 2022-07-18 15:41:28 +01:00
Ayesh Karunaratne
9f8e5182a1 INI parser: Fix typo /multipler/multiplier
Closes GH-8987.
2022-07-13 12:16:26 +02:00
Dennis Snell
492af9f88e Add ini_parse_quantity function to convert ini quantities shorthand notation to int (#8454) 2022-07-10 14:48:52 +02:00
Christoph M. Becker
8d2ed194bf Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7896: Environment vars may be mangled on Windows
2022-01-17 23:45:49 +01:00
Christoph M. Becker
93a3c71eb4 Fix GH-7896: Environment vars may be mangled on Windows
When bug 77574[1] has been fixed, the fix only catered to variables
retrieved via `getenv()` with a `$varname` passed, but neither to
`getenv()` without arguments nor to the general import of environment
variables into `$_ENV` and `$_SERVER`.  We catch up on this by using
`GetEnvironmentStringsW()` in `_php_import_environment_variables()` and
converting the encoding to whatever had been chosen by the user.

[1] <https://bugs.php.net/bug.php?id=75574>

Closes GH-7928.
2022-01-17 23:44:41 +01:00
Nikita Popov
9bff96396d Don't leak header callback if headers already sent
We need to avoid storing it in the first place, as we don't
really have a good place to release it later. If headers haven't
been sent yet, send_headers will do this. sapi_deactive happens
too late in the shutdown sequence and will result in leak reports.
2021-09-16 15:31:27 +02:00
Nikita Popov
604848188b Add additional double to string APIs
zend_double_to_str() converts a double to string in the way that
(string) would (using %.*H using precision).

smart_str_append_double() provides some more fine control over
the precision, and whether a zero fraction should be appeneded
for whole numbers.

A caveat here is that raw calls to zend_gcvt and going through
s*printf has slightly different behavior for the degenarate
precision=0 case. zend_gcvt will add a dummy E+0 in that case,
while s*printf convert this to precision=1 and will not. I'm
going with the s*printf behavior here, which is more common,
but does result in a minor change to the precision.phpt test.
2021-08-02 16:14:53 +02:00
Nikita Popov
9871a624bf Clean up some more function_exists() checks 2021-06-14 15:47:08 +02:00
Nikita Popov
7485978339 Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00
Nikita Popov
de6e401e05 Use common formatting for backtraces (#6977)
This makes debug_print_backtrace() use the same formatting as exception
backtraces. The only difference is that the final #{main} is omitted,
because it wouldn't make sense for limited backtraces, and wasn't there
previously either.
2021-05-18 11:43:37 +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