Commit graph

1304 commits

Author SHA1 Message Date
Niels Dossche
7c41509e26 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  php_cli_server: ensure single date header is present
2023-10-06 17:51:38 +02:00
Niels Dossche
a1845944ce Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  php_cli_server: ensure single date header is present
2023-10-06 17:50:13 +02:00
coppolafab
f6ac08c6a3 php_cli_server: ensure single date header is present
Currently the PHP Development Server appends a Date header in the
response, despite already set from user code.

Added a check condition before append the header, and a test file.

Closes GH-12363.
2023-10-06 17:49:30 +02:00
Niels Dossche
af15ed94bf Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Ignore optional warning output in test
2023-10-02 22:55:44 +02:00
Niels Dossche
6aa20956fb Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Ignore optional warning output in test
2023-10-02 22:55:28 +02:00
Niels Dossche
6cf76d552e Ignore optional warning output in test
Due to the greedy behaviour of regex, we can't seem to use %A?
Use a for loop with a marker instead to ignore module startup warnings.
2023-10-02 22:53:39 +02:00
Niels Dossche
98e2ff44bc Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix test under older CI configurations
2023-10-02 21:53:03 +02:00
Niels Dossche
87cd401aaf Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix test under older CI configurations
2023-10-02 21:52:52 +02:00
Niels Dossche
b140f6e9f8 Fix test under older CI configurations 2023-10-02 21:52:44 +02:00
Niels Dossche
0427e26729 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix #80092: ZTS + preload = segfault on shutdown
2023-10-02 19:42:10 +02:00
Niels Dossche
28a909d40a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix #80092: ZTS + preload = segfault on shutdown
2023-10-02 19:37:09 +02:00
Niels Dossche
bdc87b0f66 Fix #80092: ZTS + preload = segfault on shutdown
After preloading has executed, the executor globals for class_table and
function_table are still referring to the values during preloading.
If no request happens after that then these values will remain dangling
pointers. If then the -v option on CLI or -h option (and possibly
others) on CGI is provided, there is a double free.
Fix it by nulling the pointers explicitly after preloading has finished
to fix it for all SAPIs.

Closes GH-12311.
2023-10-02 19:33:41 +02:00
Ilija Tovilo
c9e5e1fc52
Switch asan build to Ubuntu 23.04 in Docker
Closes GH-12034
2023-08-23 20:40:15 +02:00
George Peter Banyard
e055e12a2c
[skip ci] Mark test as XLEAK due to LSAN bug (#12018)
This is due to apparently some combination of glibc and Clang 14 which we are unfortunately hitting
2023-08-23 13:19:13 +01:00
Ilija Tovilo
bad5298707
Make php_cli_server_pdeathsig.phpt SKIPIF more specific 2023-08-22 23:51:56 +02: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
Niels Dossche
50bb380594 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-10964: Improve `man` page about the built-in server
  Fix GH-11438: mysqlnd fails to authenticate with sha256_password accounts using passwords longer than 19 characters
2023-08-03 20:33:07 +02:00
Niels Dossche
75441d71d8 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10964: Improve `man` page about the built-in server
  Fix GH-11438: mysqlnd fails to authenticate with sha256_password accounts using passwords longer than 19 characters
2023-08-03 20:32:30 +02:00
Alexandre Daubois
997a36750b Fix GH-10964: Improve man page about the built-in server
Closes GH-11857.
2023-08-03 20:29:13 +02:00
Niels Dossche
d58e3c05c9 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix GH-11716: cli server crashes on SIGINT when compiled with ZEND_RC_DEBUG=1
2023-07-21 15:31:33 +02:00
Niels Dossche
272dc9a09c Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-11716: cli server crashes on SIGINT when compiled with ZEND_RC_DEBUG=1
2023-07-21 15:31:20 +02:00
Niels Dossche
af77d3b8da Fix GH-11716: cli server crashes on SIGINT when compiled with ZEND_RC_DEBUG=1
Closes GH-11757.
2023-07-21 15:23:56 +02:00
Ilija Tovilo
1a0ef2c1cc
Revert "Remove name field from the zend_constant struct (#10954)"
This reverts commit f42992f580.

Closes GH-11604
2023-07-17 22:32:41 +02:00
Niels Dossche
f16b34f1d0 Implement GH-10024: support linting multiple files at once using php -l
This is supported in both the CLI and CGI modes. For CLI this required
little changes.

For CGI, the tricky part was that the options parsing happens inside the
loop. This means that options passed after the -l flag were previously
simply ignored. As we now re-enter the loop we would parse the options
again, and if they are handled but don't set the script name, then CGI
will think you want to read from standard in. To keep the same "don't
parse options" behaviour I simply wrapped the options handling inside an
if.

Closes GH-10024.
Closes GH-10710.
2023-07-05 15:20:36 +02:00
Ilija Tovilo
ad1b70d67e
Revert "Revert "Remove name field from the zend_constant struct (#10954)""
This reverts commit 9f4bd3040d.
2023-07-04 16:42:40 +02:00
Máté Kocsis
9f4bd3040d
Revert "Remove name field from the zend_constant struct (#10954)"
This reverts commit f42992f580.

Fix GH-11423
2023-07-03 15:16:24 +02:00
nielsdos
d8ee89d3fa Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix interrupted CLI output causing the process to exit
2023-06-23 17:43:01 +02:00
nielsdos
b9bf9ee2cb Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix interrupted CLI output causing the process to exit
2023-06-23 17:42:45 +02:00
nielsdos
1111a9517b Fix interrupted CLI output causing the process to exit
When writing the output in the CLI is interrupted by a signal, the
writing will fail in sapi_cli_single_write(), causing an exit later in
sapi_cli_ub_write(). This was the other part of the issue in GH-11498.
The solution is to restart the write if an EINTR has been observed.

Closes GH-11510.
2023-06-23 17:39:04 +02:00
Ilija Tovilo
7f700bf603
[skip ci] Increase php_cli_server_pdeathsig.phpt retries
Fixes GH-11401
2023-06-21 19:29:43 +02:00
George Peter Banyard
d5ad75108e
More usage of known zend_str instead of C string (#11381) 2023-06-08 13:03:29 +01:00
Ilija Tovilo
bb48f5da1e
Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix bug GH-11246 cli/get_set_process_title
2023-05-31 17:10:44 +02:00
Ilija Tovilo
0bf8ecf9b3
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix bug GH-11246 cli/get_set_process_title
2023-05-31 17:10:17 +02:00
James Lucas
c6ae7a55b7
Fix bug GH-11246 cli/get_set_process_title
Fail to clobber_error only when the argv is a non-contiguous area
Don't increment the end_of_error if a non-contiguous area is encountered in environ

Closes GH-11247
2023-05-31 17:08:37 +02:00
Niels Dossche
ac5920f92b Fix GH-11141: Could not open input file: should be sent to stderr
I grepped for php_printf cases in main/ and sapi/ and converted the
cases which clearly indicate errors to fprintf(stderr, ...), like
suggested in the linked issue.

Closes GH-11163.
2023-05-05 19:31:23 +02:00
Cédric Anne
c02348cf9d
Make SERVER_SOFTWARE compliant with RFC3875 (#11093) 2023-05-05 12:43:34 +01:00
nielsdos
f6c0c60ef6 Fix GH-11104: STDIN/STDOUT/STDERR is not available for CLI without a script
I found no reason why this is done this way.
Of course this will allow users to do stupid stuff like
`fclose(STDOUT);` etc. but if they type in that code they clearly know
what they're doing...

Close GH-11169.
2023-05-03 19:54:21 +02:00
Máté Kocsis
f42992f580
Remove name field from the zend_constant struct (#10954)
As global constant names are case-sensitive now, we don't have to store them separately above the constant table.
2023-04-03 22:13:47 +02:00
Ilija Tovilo
11fbf3da35
Merge branch 'PHP-8.2'
* PHP-8.2:
  Unparallelize IO heavy tests
2023-03-27 16:34:19 +02:00
Ilija Tovilo
9b15537e9a
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Unparallelize IO heavy tests
2023-03-27 16:34:11 +02:00
Ilija Tovilo
e1ec67acd6
Unparallelize IO heavy tests
Alternative to GH-10892. This is somewhat unfortunate since these are also the
slow tests. I'm also not sure if this actually helps.

Closes GH-10953
2023-03-27 16:33:36 +02:00
Ilija Tovilo
3a9a950472
Merge branch 'PHP-8.2'
* PHP-8.2:
  [skip ci] Skip upload_2G.phpt on Cirrus
2023-03-15 02:11:59 +01:00
Ilija Tovilo
70c29f84b1
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [skip ci] Skip upload_2G.phpt on Cirrus
2023-03-15 02:11:49 +01:00
Ilija Tovilo
84e7d4a3c8
[skip ci] Skip upload_2G.phpt on Cirrus 2023-03-15 02:11:11 +01:00
Niels Dossche
f247e48def
Remove always-false check in CLI (#10723)
This is the case c == 'i', so c == '?' is always false, hence the result
is always 0.
2023-02-28 12:24:09 +01:00
George Peter Banyard
382148d7bb
Fix UBSAN warning about applying zero offset to null pointer (#10700)
vpath may be NULL here so check for it before trying to add 0 (the length of the vpath) to it.
2023-02-26 14:06:30 +00: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
Max Kellermann
d46dea169c
Make globals const (part 2) (#10610)
* Zend/zend_enum: make `forbidden_methods` static+const

* main/php_syslog: make `xdigits` static

* sapi/fpm: make several globals `const`

* sapi/phpdbg: make `OPTIONS` static

* sapi/phpdbg/help: make help texts const

* sapi/cli: make `template_map` const

* ext/ffi: make `zend_ffi_types` static

* ext/bcmath: make `ref_str` const

* ext/phar: make several globals static+const
2023-02-18 19:52:53 +00:00
David Carlier
8a267b06ca Merge branch 'PHP-8.2' 2023-02-09 19:58:00 +00:00
David Carlier
81aedad452 opcache/pcntl/cli: Fixes few functions signatures. 2023-02-09 19:57:48 +00:00