Commit Graph

1423 Commits

Author SHA1 Message Date
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
DanielEScherzer
0b94cf65e4
GH-16067: prevent invalid abstract during compilation of methods (GH-16069)
For classes that are not declared `abstract`, produce a compiler error for any
`abstract` methods. For anonymous classes, since they cannot be made abstract,
the error message is slightly different.

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-10-23 15:04:18 +02:00
Christoph M. Becker
a1d4595d65
Fix calculation of aligned buffer size
As is, for requested size which are already aligned, we over-allocate,
so we fix this.  We also fix the allocation for chunk size 1.

This issue has been reported by @kkmuffme.

Thanks to @iluuu1994 for improving the fix!

Closes GH-16161.
2024-10-10 01:56:47 +02:00
Ben Ramsey
91a07e7b75
Merge branch 'PHP-8.4' 2024-09-26 14:25:41 -05: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
d7030c2758
Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-15905: Assertion failure for TRACK_VARS_SERVER
2024-09-26 15:36:11 +02: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
DanielEScherzer
3b349db1a7
GH-15992: fix error message for single abstract method not implemented (GH-15993) 2024-09-25 22:48:02 +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
Michael Voříšek
d313ad6098
Deprecate E_STRICT constant and remove error level
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant

Closes GH-13053
2024-09-18 14:33:14 +02:00
Christoph M. Becker
6d5962074f
Dynamically xfail test cases which fail on CI (GH-15710)
This is a stop-gap measure for GH-15709 to keep CI green.
2024-09-02 18:23:52 +02:00
Gina Peter Banyard
1e3d918936
ext/core: Deprecate passing E_USER_ERROR to trigger_error() (#15308)
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_error_to_trigger_error
2024-08-09 15:51:07 +01:00
Christoph M. Becker
887e6b9c45
Fix GH-15181: Disabled output handler is flushed again
When an `PHP_OUTPUT_HANDLER_FAILURE` occurs, the output handler becomes
disabled (i.e. the `PHP_OUTPUT_HANDLER_DISABLED` flag is set).  However,
there is no guard for disabled handlers in `php_output_handler_op()`
what may cause serious issues (as reported, UB due to passing `NULL` as
the 2nd argument of `memcpy`, because the handler's buffer has already
been `NULL`ed).  Therefore, we add a respective guard for disabled
handlers, and return `PHP_OUTPUT_HANDLER_FAILURE` right away.

Closes GH-15183.
2024-08-06 16:45:51 +02:00
Niels Dossche
3ad9f4d441
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-15179: Segmentation fault (null pointer dereference) in ext/standard/url_scanner_ex.re
2024-08-03 02:05:44 +02:00
Niels Dossche
9913b83ce5
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15179: Segmentation fault (null pointer dereference) in ext/standard/url_scanner_ex.re
2024-08-03 02:05:35 +02:00
Niels Dossche
67ce8759e8
Fix GH-15179: Segmentation fault (null pointer dereference) in ext/standard/url_scanner_ex.re
Based on analysis by Ilija: https://github.com/php/php-src/issues/15179#issuecomment-2261546902

* Apply suggestions from code review

Closes GH-15206.

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-08-03 02:05:06 +02:00
Ilija Tovilo
780a8280d2
[RFC] Property hooks (#13455)
RFC: https://wiki.php.net/rfc/property-hooks

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2024-07-14 11:55:03 +02:00
Michael
6bb960092a
[skip ci] Fix some typos (#14893) 2024-07-10 00:11:36 +01:00
Calvin Buckley
64c7c4c33c Merge branch 'PHP-8.3'
* PHP-8.3:
  Declare that this test needs iconv extension
2024-07-08 18:39:36 -03:00
Calvin Buckley
192c102bde Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Declare that this test needs iconv extension
2024-07-08 18:38:59 -03:00
Calvin Buckley
43e3f577b9 Declare that this test needs iconv extension
Otherwise it would fail with the usual recommended ./configure
invocation used for RMs testing (i.e. --disable-all).
2024-07-08 18:37:52 -03:00
Niels Dossche
279d82bb07
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14808: Unexpected null pointer in Zend/zend_string.h with empty output buffer
2024-07-04 15:50:44 +02:00
Niels Dossche
519c435fc6
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14808: Unexpected null pointer in Zend/zend_string.h with empty output buffer
2024-07-04 15:50:32 +02:00
Niels Dossche
89c3e0346a
Fix GH-14808: Unexpected null pointer in Zend/zend_string.h with empty output buffer
The output buffer can be NULL when the number of bytes is zero.

Closes GH-14815.
2024-07-04 15:49:58 +02:00
Peter Kokot
c44834d8ad
Trim trailing whitespace (#14721) 2024-06-29 18:41:45 +02:00
Niels Dossche
f20707491e
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix Windows SKIPIF (#14219)
2024-05-13 22:10:53 +02:00
Niels Dossche
f16e712327
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix Windows SKIPIF (#14219)
2024-05-13 22:10:42 +02:00
Niels Dossche
719fa46150
Fix Windows SKIPIF (#14219)
PHP_OS_FAMILY never has the value WIN, for Windows platforms it is the
string "Windows". As such, this test was never executed. Fix this.
2024-05-13 22:09:47 +02:00
Máté Kocsis
2079da0158
Fix #13865 Improve parameter and return value related deprecation messages (#13913)
I added the function/method name to some compile-time deprecation messages which are related to parameters/return values. Consistently with the other similar error messages, I included the function/method name at the start of the message.
2024-04-08 22:20:32 +02:00
Máté Kocsis
330cc5cdb2
Deprecate implicit nullable parameter types (#12959)
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

Co-authored-by: Gina Peter Banyard <girgias@php.net>
2024-03-13 21:40:26 +01:00
haszi
3ce7bf2a77
Clear handler status flag in handler init
Closes GH-13087
2024-02-09 12:00:56 +00: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
haszi
703ef91edb
Improve ob_get_status() tests (#13018)
* Update basic ob_get_status() test

* Update ob test with class method, anonymous function, and invokable object as output handler

---------

Co-authored-by: haszi <haszika80@gmail.com>
2023-12-29 15:24:06 +00:00
Máté Kocsis
688c6f373c Deprecate calling ReflectionMethod::__construct() with 1 argument 2023-12-04 22:27:59 +01:00
Ilija Tovilo
f39b5c4c25
Close PHP tags in tests
Closes GH-12422
2023-10-18 17:34:10 +02:00
Oleksii Bulba
4c22060f1d
[skip ci] Removed misleading comments in tests on expected output; (#12370) 2023-10-06 13:02:09 +01:00
George Peter Banyard
d68073c23b
streams: Checking if a stream is castable should not emit warnings for user defined streams
Closes GH-10435
2023-09-08 13:22:43 +01:00
Kamil Tekiela
f907a009f9
Align highlight_string|file with HTML standard and modern browsers
Closes GH-11913
2023-08-12 15:08:28 +01:00
Máté Kocsis
c322da0606
Fix misleading pass by reference error message (#10639) 2023-07-18 15:02:38 +02:00
Ilija Tovilo
9bcdf219ec
Resolve open_basedir paths on ini update
Closes GH-10987
2023-07-18 14:43:40 +02:00
George Peter Banyard
d8696f9216
[RFC] Path to Saner Increment/Decrement operators (#10358)
* Add behavioural tests for incdec operators

* Add support to ++/-- for objects castable to _IS_NUMBER

* Add str_increment() function

* Add str_decrement() function

RFC: https://wiki.php.net/rfc/saner-inc-dec-operators

Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
Co-authored-by: Arnaud Le Blanc <arnaud.lb@gmail.com>
2023-07-17 15:51:24 +01:00
George Peter Banyard
3d4ff5ae22
RFC: Deprecate remains of string evaluated code assertions (#11671)
Link: https://wiki.php.net/rfc/assert-string-eval-cleanup
2023-07-13 15:45:32 +01:00
George Peter Banyard
39ef5ca31c
Add tests for uncastable streams and dataloss streams (#10173)
And suppress the nonsensical warnings by passing the PHP_STREAM_CAST_INTERNAL flag.
2023-07-10 13:24:23 +01:00
George Peter Banyard
99fa740acb
Use common function for TypeError on illegal offset access (#10544)
This merges all usages of emitting an offset TypeError into a new ZEND_API function
zend_illegal_container_offset(const zend_string* container, const zval *offset, int type);

Where the container should represent the type on which the access is attempted (e.g. string, array)
The offset zval that is used, where the error message will display its type
The type of access, which should be a BP_VAR_* constant, to get special message for isset/empty/unset
2023-06-06 11:28:19 +01:00