Nikita Popov
14f599ea7d
Use zend_long for resource ID
...
Currently, resource IDs are limited to 32-bits. As resource IDs
are not reused, this means that resource ID overflow for
long-running processes is very possible.
This patch switches resource IDs to use zend_long instead, which
means that on 64-bit systems, 64-bit resource IDs will be used.
This makes resource ID overflow practically impossible.
The tradeoff is an 8 byte increase in zend_resource size.
Closes GH-7436.
2021-08-31 14:58:59 +02:00
Nikita Popov
0f926815ca
Fix strict-prototypes warning
2021-08-30 10:43:21 +02:00
Nikita Popov
93a88a1d4c
Limit internal function args during fuzzing
...
Restrict the size of string arguments in the hope of avoiding some
very common timeouts with pcre. If this doesn't work, the functions
need to be disabled entirely.
2021-08-26 15:08:23 +02:00
Nikita Popov
cae80ef552
Limit internal function calls in execute fuzzer
...
Infinite recursion might occur purely through internal functions,
without reentering the executor.
2021-08-26 14:42:45 +02:00
Christoph M. Becker
be2df43b08
Fix #78919 : CLI server: insufficient cleanup if request startup fails
...
We need to run the full `php_cli_server_request_shutdown()` in case of
failing `php_cli_server_request_startup()`.
Patch contributed by @cataphract.
Closes GH-7322.
2021-08-17 12:41:06 +02:00
Joe Watkins
a2e051921a
Fix bug #81280 refuse to allow unicode chars in prompts
2021-08-11 10:35:00 +02:00
Christoph M. Becker
92b1c17417
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix #81305 : Built-in Webserver Drops Requests With "Upgrade" Header
2021-07-29 13:21:05 +02:00
Christoph M. Becker
3b461d93e1
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #81305 : Built-in Webserver Drops Requests With "Upgrade" Header
2021-07-29 13:19:04 +02:00
Christoph M. Becker
d1ccb5bd0c
Fix #81305 : Built-in Webserver Drops Requests With "Upgrade" Header
...
While our HTTP parser supports upgrade requests, the code using it does
not. Since upgrade requests are only valid for HTTP/1.1 and we neither
support any higher version, nor HTTPS yet, we do not exit early in case
of such requests, i.e. we ignore them, what is allowed by the specs.
We keep the supporting code in case we can meaningfully support upgrade
requests in the future.
Closes GH-7316.
2021-07-29 13:16:15 +02:00
Jakub Zelenka
590af4678b
Sync the FPM openmetrics status with php-fpm_exporter
2021-07-21 19:58:36 +01:00
Máté Kocsis
75a678a7e3
Declare tentative return types for Zend ( #7251 )
...
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com >
2021-07-19 13:44:20 +02:00
Christoph M. Becker
be5fd30d54
Fix Windows debug builds
...
`ZEND_ATOL` doesn't accept a size argument.
2021-07-16 00:41:38 +02:00
Christoph M. Becker
1f9b044c80
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix #80849 : HTTP Status header truncation
2021-07-15 19:16:21 +02:00
Christoph M. Becker
bb4dbbc150
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #80849 : HTTP Status header truncation
2021-07-15 19:13:58 +02:00
Christoph M. Becker
a054ef2aad
Fix #80849 : HTTP Status header truncation
...
While truncating the contents of a header is okay, we must never omit
the trailing CRLF.
Closes GH-7238.
2021-07-15 19:10:53 +02:00
Joe Watkins
60fbd6df95
replace phpdbg custom opcode dumper with O+ dump ( #7227 )
2021-07-13 15:32:14 +02:00
Christoph M. Becker
497858a043
Merge branch 'PHP-8.0'
...
* PHP-8.0:
exit_status is no longer a true global
2021-07-12 23:40:16 +02:00
Christoph M. Becker
1631b96b4b
exit_status is no longer a true global
2021-07-12 23:39:10 +02:00
Christoph M. Becker
057d2f2a00
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix #73226 : --r[fcez] always return zero exit code
2021-07-12 23:14:15 +02:00
Christoph M. Becker
0c0ecf0470
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #73226 : --r[fcez] always return zero exit code
2021-07-12 23:12:19 +02:00
Christoph M. Becker
9db3eda2cb
Fix #73226 : --r[fcez] always return zero exit code
...
This makes the behavior consistent with `--ri`, and is likely useful
for scripting.
Closes GH-7221.
2021-07-12 23:09:28 +02:00
Nikita Popov
989205e95c
Remove incorrect uses of zend_atoi()
...
zend_atoi() parses integers with size suffixes (like "128M").
These just want to use a plain number, so use ZEND_ATOL instead.
2021-07-12 16:56:00 +02:00
Nikita Popov
efbb2198d4
Return value from ZEND_ATOL
...
Instead of assigning it as part of the macro itself, which makes
usage quite awkward.
2021-07-12 16:51:24 +02:00
Nikita Popov
600dc57f24
Add ext/reflection to execute parser corpus
2021-07-04 12:31:14 +02:00
Christoph M. Becker
970a909caf
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix new test for PHP 8
2021-06-30 16:50:28 +02:00
Christoph M. Becker
9b7b4c47d6
Fix new test for PHP 8
2021-06-30 16:48:31 +02:00
Christoph M. Becker
0189c8b740
Merge branch 'PHP-8.0'
...
* PHP-8.0:
Fix #73630 : Built-in Weberver - overwrite $_SERVER['request_uri']
2021-06-30 16:17:02 +02:00
Christoph M. Becker
70b0330e53
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
Fix #73630 : Built-in Weberver - overwrite $_SERVER['request_uri']
2021-06-30 16:15:50 +02:00
Christoph M. Becker
d7db5701a3
Fix #73630 : Built-in Weberver - overwrite $_SERVER['request_uri']
...
The built-in Webserver's `on_path`, `on_query_string` and `on_url`
callbacks may be called multiple times from the parser; we must not
simply replace the old values, but need to concatenate the new values
instead.
This appears to be tricky for `on_path` due to the path normalization,
so we fail if the function is called again.
The built-in Webserver logs errors during request parsing to stderr,
but this is ignored by the php_cli_server framework, and apparently the
Webserver does not send a resonse at all in such cases (instead of an
4xx). Thus we can only check that a request with an overly long path
fails.
Closes GH-7207.
2021-06-30 16:13:08 +02:00
Patrick Allaert
aff365871a
Fixed some spaces used instead of tabs
2021-06-29 11:30:26 +02:00
Joe Watkins
6318040df2
remove specialized printing from phpdbg ( #7156 )
2021-06-17 14:22:33 +02:00
Nikita Popov
9871a624bf
Clean up some more function_exists() checks
2021-06-14 15:47:08 +02:00
Joe Watkins
2c33578c58
Fix #81135 unknown help topic in phpdbg fails assertion
2021-06-13 22:19:14 +02:00
Joe Watkins
766e6b0856
ditch remote
2021-06-13 21:08:35 +02:00
Joe Watkins
cded43fd8d
drop phpdbg web helper extension and wait command ( #7144 )
2021-06-13 14:02:11 +02:00
Nikita Popov
39131219e8
Migrate more SKIPIF -> EXTENSIONS ( #7139 )
...
This is a mix of more automated and manual migration. It should remove all applicable extension_loaded() checks outside of skipif.inc files.
2021-06-11 12:58:44 +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
dd91170ee2
Avoid make_printable_zval() in other printf implementations as well
...
This is the same as the previous commit, for copies of that code.
2021-06-10 10:19:05 +02:00
David CARLIER
7d5a9dd05d
Litespeed sapi OpenBSD build fix ( #3999 )
...
attempt to core dump in the proper place.
implement sendfile
2021-06-09 09:11:54 +02:00
Nikita Popov
1af891306a
Fix upload_2G test
...
Include the new full_path key. This test is skipped on CI but
fails locally.
2021-05-21 16:02:40 +02:00
George Peter Banyard
e7135cb817
Use zend_string_equals_* API in a couple of more place
...
Closes GH-6979
2021-05-14 13:45:17 +01:00
Nikita Popov
8d409d955f
Drop test-phpdbg and clean-phpdbg targets
...
test-phpdbg doesn't work entirely, and there doesn't seem to be
any cause for having a target that cleans phpdbg in particular.
2021-05-14 12:20:00 +02:00
Nikita Popov
959e5787bd
Disable -a mode without readline
...
To avoid confusing, as -a without readline is not actually
interactive.
Discussion: https://externals.io/message/114426
Closes GH-6976.
2021-05-14 12:10:46 +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
George Peter Banyard
ff988a6f4f
Fix remaining [-Wstrict-prototypes] warnings
...
Two missing void qualifiers for parameter list.
2021-05-12 19:02:48 +01:00
George Peter Banyard
c40231afbf
Mark various functions with void arguments.
...
This fixes a bunch of [-Wstrict-prototypes] warning,
because in C func() and func(void) have different semantics.
2021-05-12 14:55:53 +01:00
Nikita Popov
07061482a0
Fix segfault in php -a without readline
2021-05-11 11:39:04 +02:00
Joe Watkins
8b8c8fd79c
Merge branch 'PHP-8.0'
...
* PHP-8.0:
missing ;
2021-05-11 11:11:35 +02:00
Joe Watkins
33a93b5ed7
Merge branch 'PHP-7.4' into PHP-8.0
...
* PHP-7.4:
missing ;
2021-05-11 11:10:52 +02:00
Joe Watkins
ef3e0ee08a
missing ;
2021-05-11 11:10:38 +02:00