Commit graph

136787 commits

Author SHA1 Message Date
Niels Dossche
ae0ba1a5c6 Add parenthesis to macro arguments in internal_helpers.h 2024-07-08 06:09:04 -07:00
Niels Dossche
3303c15754 Make some pointers const in php_dom.h 2024-07-08 06:09:04 -07:00
Niels Dossche
dd795022fa Remove unnecessary include statements from dom 2024-07-08 06:09:04 -07:00
Niels Dossche
c695b1dc88
Improve error message for too long file in ext/tidy (#14870)
As suggested in https://github.com/php/php-src/pull/14862#discussion_r1667788025
2024-07-08 15:06:57 +02:00
Peter Kokot
2f97ad9c10
[skip ci] Add link to FPM docs in FPM man page (#14853)
This removes obsolete link to php-fpm.org and redundant manual link in
favor of a dedicated FPM chapters.

Can be tested with:

    man sapi/fpm/php-fpm.8.in
2024-07-08 14:59:45 +02:00
Peter Kokot
083493be57
Fix AS_VAR_* checks (#14868)
AS_VAR_SET_IF doesn't behave the same as "test -n" and/or "test -z",
which becomes an issue for Apache's ZTS automatic enabling and CFLAGS
edge case where it would be explicitly set to empty value. It is safer
to use AS_VAR_IF instead of AS_VAR_SET_IF in these cases.
2024-07-08 14:20:58 +02:00
Niels Dossche
0b3c506b18
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix memory leak in tidy_repair_file()
2024-07-08 13:31:25 +02:00
Peter Kokot
300d092449
Autotools: Refactor phpdbg POSIX Threads checks (#14865)
- AS_VAR_IF, AS_VAR_APPEND used and CS synced
- Added one missing AC_MSG_RESULT to properly put the configure output
  log on each line
- AH_TEMPLATE used for HAVE_USERFAULTFD_WRITEFAULT to have help text on
  lesser places
- Redundant terminating semicolons removed
- Redundant PTHREADS_CHECK call removed as it is already done in
  configure.ac and before including SAPI M4 stubs
- Redundant CFLAGS and LIBS storing and restoring removed
2024-07-08 13:26:53 +02:00
Niels Dossche
b8077e46ed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix memory leak in tidy_repair_file()
2024-07-08 13:25:10 +02:00
Niels Dossche
c34def581a
Fix memory leak in tidy_repair_file()
When dealing with a file, we must free the contents if the function
fails. While here, also fix the error message because previously it
sounded like the filename was too long while in fact the file itself
is too large.

Closes GH-14862.
2024-07-08 13:24:32 +02:00
Peter Kokot
3d8bd8fe4f
Remove unused HAVE_PHPDBG (#14864)
This is not defined on Windows and isn't used. Also phpdbg doesn't
install any headers to the public usage.
2024-07-08 00:42:05 +02:00
Peter Kokot
1bdf9aa38d
Remove support for EOL Apache 2.0 and 2.2 in favor of 2.4+ (#14664)
Apache 2.2 has been marked as EOL in December 2017 and doesn't receive
security patches any longer. Also, most *nix distributions and packages
mostly support 2.4 as minimum by now.

On Windows, this removes the configure option --enable-apache2-2handler
and merges the --enable-apache2handler and --enable-apache2-4handler
into a single option with favoring the --enable-apache2handler.

- The upstream MODULE_MAGIC_NUMBER is deprecated in favor of
  MODULE_MAGIC_NUMBER_MAJOR in apache2/ap_mmn.h
- The initial upstream MODULE_MAGIC_NUMBER_MAJOR was 20111025 in Apache
  2.4.0
- The upstream APLOG_USE_MODULE is always available since Apache 2.3.6
- The upstream CORE_PRIVATE is unnecessary and ignored since Apache
  2.4.0

See:
https://forum.apachehaus.com/news-general-discussion/apache-2-2-users-your-time-is-running-out/

Discussion: https://news-web.php.net/php.internals/124067
2024-07-08 00:07:55 +02:00
Peter Kokot
80e0c0aaf4
Autotools: Refactor dmalloc check (#14726)
- AS_VAR_APPEND used for enabling Dmalloc check-funcs token
- CS synced
2024-07-07 23:35:50 +02:00
Peter Kokot
e9254494ff
Autotools: Simplify POSIX Threads check (#14855)
The PTHREADS_CHECK is using cache variables so it is run only once early
during the configuration phase, before including SAPI and other M4
files. This removes the TSRM_CHECK_PTHREADS macro and moves the POSIX
Threads check after the PHP_THREAD_SAFETY variable is set in
configure.ac.

The check and error throw in PHP_BUILD_THREAD_SAFE is also joing into
this single check.

This removes the redundant tsrm.m4 file and PHP_CONFIGURE_PART call for
TSRM as it doesn't run any configuration checks anymore.
2024-07-07 22:44:44 +02:00
Peter Kokot
9def76ebbc
Autotools: Refactor crypt check in ext/standard (#14856)
- AH_TEMPLATE sets the CPP macro help text on a single place
- AC_DEFINE can be used instead of AC_DEFINE_UNQUOTED
- AS_VAR_IF used and CS synced
- crypt() function is at this point required as all required algorithm
  checks are depending on it and error is thrown if not found when using
  external crypt library
2024-07-07 21:46:44 +02:00
Peter Kokot
2acd4c2bbc
Autotools: Sync HAVE_ERASE_EMPTY_LINE help text (#14857)
HAVE_ERASE_EMPTY_LINE always gets the last AC_DEFINE help text, so it is
simpler to have the same help message for both definitions (readline and
editline). First text never got into header via autoheader anyway.
2024-07-07 21:31:31 +02:00
David CARLIER
1db75d42bb
ext/sockets: socket_get_option/socket_set_option SO_LINGER_SEC. (#14858)
9672cd9469 follow-up.
2024-07-07 14:23:01 +01:00
Niels Dossche
23391f1fe7
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
2024-07-07 13:18:42 +02:00
Niels Dossche
d3992b6d09
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
2024-07-07 13:18:35 +02:00
Niels Dossche
b44ad27a78
Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
Closes GH-14847.
2024-07-07 13:18:01 +02:00
David Carlier
58b34fbfcc
[ci skip] UPGRADING fix for pcntl_waitid constants 2024-07-07 11:06:59 +01:00
Vladimir Vrzić
c2fd071db7
ext/pcntl: Added new function pcntl_waitid
to obtain status information pertaining termination, stop, and/or
continue events in one the caller's child processes.

close GH-14617
2024-07-07 11:04:14 +01:00
Peter Kokot
af29403ea0
Enable erase_empty_line in ext/readline (#14526)
This wasn't activated due to inconsistent availability over the
editline/readline versions and variants. This now checks whether the
rl_erase_empty_line variable is available in library headers and enables
it based on that. On Windows this is for now still disabled due to
wineditline library, which doesn't have this yet.

Documentation already mentions the erase_empty_line setting:
https://www.php.net/manual/en/function.readline-info.php
2024-07-07 04:36:25 +02:00
Peter Kokot
2ebef11e83
Update http links to https and sync www.php.net URLs (#14854) 2024-07-07 04:23:08 +02:00
Peter Kokot
42530c6543
Remove unused SMART_STR_PREALLOC (#14848) 2024-07-07 01:04:53 +02:00
Niels Dossche
f4af8f3837
Fix libxml test compatibility in xsl 2024-07-07 00:22:41 +02:00
Niels Dossche
477c2afb48 Fix typo in simplexml.c 2024-07-06 14:58:50 -07:00
Niels Dossche
acda7ed5c3 Stop using reserved names in simplexml 2024-07-06 14:58:50 -07:00
Niels Dossche
c6d0181c75 Fix narrowing warning 2024-07-06 14:58:42 -07:00
Niels Dossche
f16590637c Stop using reserved name in php_xsl.h 2024-07-06 14:58:42 -07:00
Niels Dossche
ac4ed1cca6 Remove unused argument 2024-07-06 14:58:42 -07:00
Niels Dossche
0a1f1dd191 Place macro argument in parentheses 2024-07-06 14:58:42 -07:00
Niels Dossche
e2189beaca
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14639: Member access within null pointer in ext/spl/spl_observer.c
2024-07-06 23:58:37 +02:00
Niels Dossche
8ea3f154be
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14639: Member access within null pointer in ext/spl/spl_observer.c
2024-07-06 23:58:20 +02:00
Niels Dossche
0d4e0c013e
Fix GH-14639: Member access within null pointer in ext/spl/spl_observer.c
`spl_object_storage_attach_handle` creates an entry already, but only
fills it in at the end with `spl_object_storage_create_element` which
allocates memory. In this case the allocation fails and we're left with
a NULL slot. Doing the allocation first isn't an option because we want
to check whether the slot is occupied before allocating memory.
The simplest solution is to set the entry to NULL and check for a NULL
pointer upon destruction.

Closes GH-14849.
2024-07-06 23:57:46 +02:00
Niels Dossche
776939c3db Avoid function pointer cast to preserve ability to do CFI 2024-07-06 13:49:45 -07:00
Niels Dossche
ff3e7679b1 Avoid pointless cast to prevent implementation-defined conversion warning 2024-07-06 13:49:45 -07:00
Niels Dossche
292e936ca8 Handle invalid values better in PHP_XML_OPTION_SKIP_TAGSTART 2024-07-06 13:49:45 -07:00
Niels Dossche
19358d638b Stop using reserved names 2024-07-06 13:49:45 -07:00
Niels Dossche
335d6f023f Fix grammar mistake in comment in xml.c 2024-07-06 13:49:45 -07:00
Niels Dossche
be2d9fd80e Remove unused include from xml.c 2024-07-06 13:49:45 -07:00
Niels Dossche
ec1998987b Remove pointless const specifier on scalar argument 2024-07-06 13:49:45 -07:00
Niels Dossche
2ab24b0a94 Remove unused arguments from _external_entity_ref_handler() 2024-07-06 13:49:45 -07:00
Jorg Adam Sowa
8e1561cdbe
Check session_create_id() input for null byte (#14728) 2024-07-06 21:18:35 +01:00
David Carlier
c14fa48526
Merge branch 'PHP-8.3' 2024-07-06 20:44:47 +01:00
David Carlier
0b28914a26
Merge branch 'PHP-8.2' into PHP-8.3 2024-07-06 20:44:20 +01:00
David Carlier
237518763f
Fix GH-14774 time_sleep_until overflow. 2024-07-06 20:43:59 +01:00
Niels Dossche
b41e90c6f9
Fix bug #81481 (xml_get_current_byte_index limited to 32-bit numbers on 64-bit builds) (#14845)
The return value is long in both expat and expat2 (with XML_LARGE_SIZE
not set).
2024-07-06 18:34:17 +02:00
Arnaud Le Blanc
ec19abf161
[ci skip] NEWS for GH-14801 2024-07-06 17:59:55 +02:00
Niels Dossche
f0441e05b8
Add LIBXML_NO_XXE constant (#14844)
This constant is available as of libxml2 2.13, and is used together with
LIBXML_NOENT to allow entity subsitution but disallow external entities.
2024-07-06 17:43:46 +02:00