PHP 8 changes the way string to number comparisons are performed: https://wiki.php.net/rfc/string_to_number_comparison
In particular, when calling `max()` on an array with numeric values and a non-numeric string, in PHP 8 the string is returned instead of a number.
For `::import_theme_starter_content()`, this resulted in retrieving the `_multiwidget` property instead of the maximum widget number for a particular type.
By explicitly ignoring the `_multiwidget` property, we make sure to retrieve the correct widget number value.
Follow-up to [48960], [49043].
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49076 602fd350-edb4-49c9-b593-d223f7449a82
Xdebug supports PHP 8 only from version 3.0, which is not released yet.
Once Xdebug 3.0 is released and included in the Docker image, this should be uncommented again.
Follow-up to [48957], [49037].
See #50913, #50902.
git-svn-id: https://develop.svn.wordpress.org/trunk@49074 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a fatal error on PHP 8 caused by passing a `false` value to `fread()`, instead of a file resource.
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49073 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a fatal error on PHP 8 caused by passing an empty string to `mysqli_query()`, and maintains the current behaviour.
Follow-up to [48980], [48981].
See #50913, #50639.
git-svn-id: https://develop.svn.wordpress.org/trunk@49072 602fd350-edb4-49c9-b593-d223f7449a82
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.
These tests rely on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025], [49045], [49050], [49052].
See #50639, #50640.
git-svn-id: https://develop.svn.wordpress.org/trunk@49069 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a "Missing format specifier at end of string" fatal error on PHP 8, and maintains the current behaviour.
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49068 602fd350-edb4-49c9-b593-d223f7449a82
* Make the "Copied!" text green.
* Make the button verbiage clear that it's copied "to clipboard".
Props garrett-eclipse, mukesh27.
Fixes#51355.
git-svn-id: https://develop.svn.wordpress.org/trunk@49064 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a JS error when refreshing the "Attachment details" modal for an item that is not currently queried.
Follow-up to [41021].
Props Mista-Flo, mukesh27.
Fixes#51395.
git-svn-id: https://develop.svn.wordpress.org/trunk@49062 602fd350-edb4-49c9-b593-d223f7449a82
The parameter's default value is different from the one in `WP_Term_Query::__construct()`, and should be documented accordingly.
This also clarifies that the `taxonomy` parameter of `wp_list_categories()` only accepts a string, not an array.
Follow-up to [40903], [41767], [45894], [45895].
Props grapplerulrich, mukesh27, TimothyBlynJacobs, SergeyBiryukov.
Fixes#51378. See #47896.
git-svn-id: https://develop.svn.wordpress.org/trunk@49060 602fd350-edb4-49c9-b593-d223f7449a82
This addresses an "Undefined constant `MB_OVERLOAD_STRING`" fatal error in the `ParagonIE_Sodium_Core_Util::isMbStringOverride()` method.
In PHP 8, the `MB_OVERLOAD_STRING` constant has been removed, along with the `mbstring` function overloading feature.
Fixes#51399.
git-svn-id: https://develop.svn.wordpress.org/trunk@49057 602fd350-edb4-49c9-b593-d223f7449a82
This adds support for the secure and ipv6 variants of the already allowed irc protocol.
Props arealnobrainer, markparnell, ctmartin.
git-svn-id: https://develop.svn.wordpress.org/trunk@49055 602fd350-edb4-49c9-b593-d223f7449a82
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.
This test relies on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025], [49045], [49050].
See #50639, #50640.
git-svn-id: https://develop.svn.wordpress.org/trunk@49052 602fd350-edb4-49c9-b593-d223f7449a82
`author_avatar_urls` should be present in the comment data array keys, not values.
The test only passed accidentally due to `assertContains()` not performing a strict type check.
See #38266, #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49051 602fd350-edb4-49c9-b593-d223f7449a82
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.
This test relies on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025], [49045].
See #50639, #50640.
git-svn-id: https://develop.svn.wordpress.org/trunk@49050 602fd350-edb4-49c9-b593-d223f7449a82
Previously, the PHP Fileinfo extension used to detect CSV files as `text/plain`.
In PHP 8, this has changed, and CSV files are detected as `application/csv`.
Follow-up to [44438].
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49049 602fd350-edb4-49c9-b593-d223f7449a82
This outputs a proper message if the requirement is not met, instead of an obscure failure further in the test.
These tests rely on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025], [49045].
See #50639, #50640.
git-svn-id: https://develop.svn.wordpress.org/trunk@49047 602fd350-edb4-49c9-b593-d223f7449a82
If the sizes data could not be retrieved, the controller returns an empty object instead of an array.
This makes sure that the value is in fact an array before proceeding, and outputs a proper message in case of failure, instead of an obscure PHP error further in the test.
Follow-up to [49044].
See #50913, #51393.
git-svn-id: https://develop.svn.wordpress.org/trunk@49046 602fd350-edb4-49c9-b593-d223f7449a82
This outputs a proper message if the requirement is not met, instead of an obscure PHP error further in the test.
These tests rely on multiple resized copies of a test JPEG image being generated and available.
Follow-up to [49010], [49024], [49025].
See #50639, #50640.
git-svn-id: https://develop.svn.wordpress.org/trunk@49045 602fd350-edb4-49c9-b593-d223f7449a82
This outputs a proper message in case of failure, instead of an obscure PHP error further in the test.
Props TimothyBlynJacobs.
See #50913, #51393.
git-svn-id: https://develop.svn.wordpress.org/trunk@49044 602fd350-edb4-49c9-b593-d223f7449a82
PHP 8 changes the way string to number comparisons are performed: https://wiki.php.net/rfc/string_to_number_comparison
In particular, checking if a non-empty, non-numeric string is greater than zero in PHP 8 evaluates to `true`, not `false`.
For `wp_insert_term()`, this resulted in a "Parent term does not exist" error for a non-numeric string, instead of discarding the value.
By explicitly casting the value to `int`, we make sure to compare both values as numbers, rather than a string and a number.
Follow-up to [29196], [29830], [29867].
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49043 602fd350-edb4-49c9-b593-d223f7449a82
When changing exports location via these filters, make sure to migrate the files to the new directory, to avoid breaking any existing exports.
Follow-up to [48127], [48330].
Props garrett-eclipse.
Fixes#51361.
git-svn-id: https://develop.svn.wordpress.org/trunk@49042 602fd350-edb4-49c9-b593-d223f7449a82
Add inline documentation for the 'template' arg accepted by
register_post_type().
Props milana_cap.
See #46261.
git-svn-id: https://develop.svn.wordpress.org/trunk@49041 602fd350-edb4-49c9-b593-d223f7449a82
The block editor provides its own interface for managing screen options, so we
can safely hide Screen Options tab found in the top right of the page.
Props aduth.
See #46157.
git-svn-id: https://develop.svn.wordpress.org/trunk@49040 602fd350-edb4-49c9-b593-d223f7449a82
This revision includes a change to only call `libxml_disable_entity_loader()` in PHP < 8, in order for unit tests in the `import` group to pass on PHP 8.
This function has been deprecated in PHP 8.0 because in libxml 2.9.0, external entity loading is disabled by default, so this function is no longer needed to protect against XXE attacks.
Follow-up to [46542], [48789].
Props jrf.
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49039 602fd350-edb4-49c9-b593-d223f7449a82
* Replace the `Match` interface with `ParametersMatch`, to avoid parse errors due to `match` being a reserved keyword in PHP 8.
* Replace `ReflectionParameter::getClass()` usage, which is deprecated in PHP 8.
This allows tests relying on the `getMockForAbstractClass()` and `getMockBuilder()` methods to run again on PHP 8.
When the test suite is updated for compatibility with PHPUnit 9.x, these overrides can be removed.
Follow-up to [48972].
See #50913, #50902.
git-svn-id: https://develop.svn.wordpress.org/trunk@49037 602fd350-edb4-49c9-b593-d223f7449a82
This avoids a few PHP notices if the `include_selected` parameter was specified and a non-existing user ID was passed.
Props campusboy1987.
Fixes#51370.
git-svn-id: https://develop.svn.wordpress.org/trunk@49036 602fd350-edb4-49c9-b593-d223f7449a82
This outputs a proper message in case of failure, instead of an obscure PHP error further in the test.
See #50913.
git-svn-id: https://develop.svn.wordpress.org/trunk@49032 602fd350-edb4-49c9-b593-d223f7449a82