Older GCC versions (< 7.0) don't support the -Wno-implicit-fallthrough
compiler flag. This adds the flag conditionally in case some other
compiler will run into same issue.
Fixes GH-13330
We were using atoi, which is only for integers. When the size does not
fit in an integer this breaks. Use ZEND_STRTOUL instead. Also make sure
invalid data isn't accidentally parsed into a file size.
Closes GH-15035.
Lower branches suffer from this as well but we cannot change the
behaviour there.
We also add NULL checks to check for allocation failure.
Closes GH-15014.
TIDY_APPLY_CONFIG can early return because it's a macro, but then the
cleanup paths are not executed. Transform this to a real function and
handle the cleanups correctly at the callsites.
Closes GH-15046.
I don't know why this code was here in the first place, it is present
since the initial implementation. It doesn't make sense because:
1. It would require updating the refcounts if the document wasn't
actually already set.
2. We enforce that the document is the same as the target document by
this point, so setting the tree is pointless.
AIX 7.1 has SOCK_CONN_DGRAM, but not SOCK_DCCP; the previous change
conflated the availability between the two definitions. Add an
additional #ifdef for this.
Quoted m4_normalize will expand and change its argument later in the
macro call when M4 is processing the *.m4 sources. Without quotes the
already normalized string is passed to the macro directly. In these
specific cases generated configure script is the same. This is more for
consistency to have this synced and not repeat the pattern too much
in the future when copy/pasting. Note, that many AC_* macros require
similar behavior already (for example, AC_CHECK_FUNCS.)
The Windows CI of the `PHP-8.2` to `PHP-8.3` branches still use the
`php-sdk-2.2.0` which is almost five years old, and does not fetch the
updated dependencies from https://downloads.php.net/~windows.
The `master` branch CI uses `php_downloads_server_migration_v1`, which
has been superseded a few months ago[1]. So switching to the
`php-sdk-2.3.0` makes sense there, too.
[1] <php/php-sdk-binary-tools@19c8ccb>
Closes GH-14991.
The zend_object.properties HashTable needs to be built just in time by calling
rebuild_object_properties() on the object before accessing it. Normally this is
done automatically in zend_std_get_properties(), but we do it manually in a few
places.
In this change I introduce an inline variant of zend_std_build_properties(), and
refactor these places to use it instead of calling rebuild_object_properties()
manually.
rebuild_object_properties() renamed as rebuild_object_properties_internal(), to
enforce usage of zend_std_get_properties() or zend_std_build_properties_ex().
Closes GH-14996
This introduces a new helper php_dom_create_nullable_object() that does
the NULL check and puts NULL in return_value. Otherwise it runs
php_dom_create_object(). This deduplicates a bit of code.