-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FormFileUpload
: Prevent HEIC and HEIF files from always being uploaded on Safari
#67139
Conversation
This reverts commit c5921d7.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
const [ isSafari, setIsSafari ] = useState( false ); | ||
useEffect( () => { | ||
setIsSafari( | ||
/^((?!chrome|android).)*safari/i.test( navigator.userAgent ) | ||
); | ||
}, [] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I do a similar thing to get Safari like in duotone.js
.
const isSafari =
window?.navigator.userAgent &&
window.navigator.userAgent.includes( 'Safari' ) &&
! window.navigator.userAgent.includes( 'Chrome' ) &&
! window.navigator.userAgent.includes( 'Chromium' );
eslint alerts: Use of DOM global 'window' is forbidden in module scope
.
Also, checking the userAgent
with a variable will trigger:
Use of DOM global 'navigator' is forbidden in the render-cycle of a React FC, consider moving this inside useEffect()
.
I'm not really convinced this is a good fix.
Pinging @WordPress/gutenberg-components for a quality check 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to me like a reasonable and unavoidable bandaid fix in this case 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be wrong but moving the const isSafari = ...
to the top of the file (after the imports) won't trigger the error? If not, there seems to be a function isSafari()
in the build, imported from @ariakit? Not sure if/how that can be used though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of executing that in a useEffect
is so we don't break SSR use cases.
there seems to be a function isSafari() in the build, imported from https://github.com/ariakit?
Good find! But that isn't really a public API and the underlying detection mechanisms seem similar anyway. We can always encapsulate it ourselves for reuse if we need this kind of browser detection more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, browser detection from userAgent is generally not recommended. This seems to be the second place it's needed though, after duotone.js. This may be pretty short-lived considering one of the causes for it is already fixed in Chromium and is in Chrome Canary. Seems WP 6.7.1 may end up with reverting this fix completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of executing that in a useEffect is so we don't break SSR use cases.
Seems like a weird hack for SSR :( Btw, using lazy initialization for state silences the warnings.
const [ isSafari ] = useState( () =>
/^((?!chrome|android).)*safari/i.test( navigator?.userAgent )
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal here is to reference window
or navigator
in a safe way, so that it doesn't crash when run in Node.js which doesn't have these globals.
The ssr-friendly
ESLint plugin is not perfect and it both accepts code that is bad and rejects code that is good.
This is OK but ssr-friendly
will complain:
const isSafari = typeof window !== 'undefined' ? window.navigator.userAgent.includes(...) : false;
And this @Mamaduka's suggestion will crash because the useState
initializer is called during SSR. ssr-friendly
just doesn't detect it:
const [ isSafari ] = useState( () => window.navigator.userAgent.includes(...) );
Be careful that this will also crash in Node.js despite the optional chaining:
window?.navigator
Because the window
global doesn't exist, the code will crash even before getting to apply the ?.
operator. That's why the typeof window
check is done, because typeof
can deal with undefined variables.
One of good solutions is also using globalThis
:
globalThis.window?.navigator.userAgent
globalThis.navigator?.userAgent
The globalThis
variable is always present, and in browsers it has the window
and navigator
fields, in Node.js it doesn't have them. The ?.
operator works here because we're now dealing with fields of an object, not with global variables.
I think we shouldn't need useEffect
here. The UA check can be done in one pass, the component doesn't need to be rendered twice.
So, all you need is to find a solution that:
- Actually works and doesn't crash, even if
ssr-friendly
doesn't warn you - Satisfies the
ssr-friendly
rules. You might need to reshuffle code that is already good, e.g., by wrapping it in a function etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/components/CHANGELOG.md
Outdated
@@ -2,6 +2,10 @@ | |||
|
|||
## Unreleased | |||
|
|||
### Bug Fixes | |||
|
|||
- `FormFileUpload`: Image Block: Fix transparent pngs not being uploaded correctly on Safari browser. ([67139](https://github.com/WordPress/gutenberg/pull/67139)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the changelog for the components package, so we need to describe the change in terms of the FormFileUpload component, not for whatever Gutenberg feature it's fixing. Something like this maybe?
- `FormFileUpload`: Image Block: Fix transparent pngs not being uploaded correctly on Safari browser. ([67139](https://github.com/WordPress/gutenberg/pull/67139)). | |
- `FormFileUpload`: Prevent HEIC and HEIF files from being uploaded on Safari ([67139](https://github.com/WordPress/gutenberg/pull/67139)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 21a1cb0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not familiar enough with these parts to review the code actual code changes, but this is testing well for me.
In both Safari and Chrome, I'm able to upload JPGs and HEIC images by both dragging and dropping and using the Upload option to select the files. The accept
attribute is correctly reflecting the expected value for each browser.
FormFileUpload
: Prevent HEIC and HEIF files from being uploaded on Safari
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix!
Just as a note for similar checks in the future though — although this works in this particular case, we need to be careful that we don't assume that the existence of globalThis.navigator
implies that we are in a browser context, or that the APIs are the same as a browser. Node v21 adds a partial implementation of window.navigator
to globalThis
.
: accept; | ||
// Prevent Safari from adding "image/heic" and "image/heif" to the accept attribute. | ||
const isSafari = | ||
globalThis.navigator?.userAgent.includes( 'Safari' ) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know what, if I look closely at the Node docs, there is a small range of versions where navigator
exists (>= v21.0.0) but navigator.userAgent
doesn't (< v21.1.0) 😂 So maybe optional chain that, too. This kind of edge case may already be a reason to prefer approaches that are safer in the general case (e.g. useEffect
or globalThis.window?.navigator
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 460ece4
…Safari (#67139) * Revert "Ensure HEIC files selectable from “Upload” button (#66292)" This reverts commit c5921d7. * Update changelog * Make it Safari conditional * Remove extra whitespaces * Update changelog * Use globalthis * Forgot a # * Make it safer Co-authored-by: cbravobernal <cbravobernal@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: azaozz <azaozz@git.wordpress.org> Co-authored-by: desrosj <desrosj@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: jsnajdr <jsnajdr@git.wordpress.org>
Cherry-picked to |
FormFileUpload
: Prevent HEIC and HEIF files from being uploaded on SafariFormFileUpload
: Prevent HEIC and HEIF files from almways being uploaded on Safari
FormFileUpload
: Prevent HEIC and HEIF files from almways being uploaded on SafariFormFileUpload
: Prevent HEIC and HEIF files from always being uploaded on Safari
Syncs Editor packages for WordPress 6.7.1 RC1. Includes the following PRs: - WordPress/gutenberg#66945 - WordPress/gutenberg#66889 - WordPress/gutenberg#67139 Props mmaattiiaass, ramonopoly, mamaduka, get_dave, poena, ntsekouras, mcsf, jsnajdr, 0mirka00, desrosj, joemcgill, cbravobernal, azaozz, room34, mayanktripathi32, im3dabasia1, jonsurrell. Fixes #62478, #62447. git-svn-id: https://develop.svn.wordpress.org/branches/6.7@59437 602fd350-edb4-49c9-b593-d223f7449a82
Syncs Editor packages for WordPress 6.7.1 RC1. Includes the following PRs: - WordPress/gutenberg#66945 - WordPress/gutenberg#66889 - WordPress/gutenberg#67139 Props mmaattiiaass, ramonopoly, mamaduka, get_dave, poena, ntsekouras, mcsf, jsnajdr, 0mirka00, desrosj, joemcgill, cbravobernal, azaozz, room34, mayanktripathi32, im3dabasia1, jonsurrell. Fixes #62478, #62447. Built from https://develop.svn.wordpress.org/branches/6.7@59437 git-svn-id: http://core.svn.wordpress.org/branches/6.7@58823 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Syncs Editor packages for WordPress 6.7.1 RC1. Includes the following PRs: - WordPress/gutenberg#66945 - WordPress/gutenberg#66889 - WordPress/gutenberg#67139 Reviewed by desrosj. Merges [59437] to trunk. Props mmaattiiaass, ramonopoly, mamaduka, get_dave, poena, ntsekouras, mcsf, jsnajdr, 0mirka00, desrosj, joemcgill, cbravobernal, azaozz, room34, mayanktripathi32, im3dabasia1, jonsurrell. Fixes #62478, #62447. git-svn-id: https://develop.svn.wordpress.org/trunk@59438 602fd350-edb4-49c9-b593-d223f7449a82
Syncs Editor packages for WordPress 6.7.1 RC1. Includes the following PRs: - WordPress/gutenberg#66945 - WordPress/gutenberg#66889 - WordPress/gutenberg#67139 Reviewed by desrosj. Merges [59437] to trunk. Props mmaattiiaass, ramonopoly, mamaduka, get_dave, poena, ntsekouras, mcsf, jsnajdr, 0mirka00, desrosj, joemcgill, cbravobernal, azaozz, room34, mayanktripathi32, im3dabasia1, jonsurrell. Fixes #62478, #62447. Built from https://develop.svn.wordpress.org/trunk@59438 git-svn-id: https://core.svn.wordpress.org/trunk@58824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Syncs Editor packages for WordPress 6.7.1 RC1. Includes the following PRs: - WordPress/gutenberg#66945 - WordPress/gutenberg#66889 - WordPress/gutenberg#67139 Reviewed by desrosj. Merges [59437] to trunk. Props mmaattiiaass, ramonopoly, mamaduka, get_dave, poena, ntsekouras, mcsf, jsnajdr, 0mirka00, desrosj, joemcgill, cbravobernal, azaozz, room34, mayanktripathi32, im3dabasia1, jonsurrell. Fixes #62478, #62447. Built from https://develop.svn.wordpress.org/trunk@59438 git-svn-id: http://core.svn.wordpress.org/trunk@58824 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Syncs Editor packages for WordPress 6.7.1 RC1. Includes the following PRs: - WordPress/gutenberg#66945 - WordPress/gutenberg#66889 - WordPress/gutenberg#67139 Reviewed by desrosj. Merges [59437] to trunk. Props mmaattiiaass, ramonopoly, mamaduka, get_dave, poena, ntsekouras, mcsf, jsnajdr, 0mirka00, desrosj, joemcgill, cbravobernal, azaozz, room34, mayanktripathi32, im3dabasia1, jonsurrell. Fixes #62478, #62447. git-svn-id: https://develop.svn.wordpress.org/trunk@59438 602fd350-edb4-49c9-b593-d223f7449a82
* Global styles: preload `/global-styles` endpoint responses This commit fixes a regression whereby requests to global styles endpoints were not being preloaded, resulting in several requests being fired clientside unnecessarily. For performance reasons, we preload the requests so that the data is in the editor store and ready to use straight away. The outcome is that the editor loads more quickly. Follow-up to [62042]. Props ellatrix, ramonopoly, apermo, peterwilsoncc. Fixes #62315. git-svn-id: https://develop.svn.wordpress.org/trunk@59316 602fd350-edb4-49c9-b593-d223f7449a82 * Media: Fix converting of all HEIC/HEIF images to JPEGs after uploading regardless of dimensions. Props ironprogrammer, adamsilverstein, azaozz. Fixes #62305. git-svn-id: https://develop.svn.wordpress.org/trunk@59317 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Update packages for 6.7 RC 2 Syncs `@wordpress/*` packages to the `wp-6.7` npm tag. Props kevin940726, aaronrobertshaw. See #62309. git-svn-id: https://develop.svn.wordpress.org/trunk@59318 602fd350-edb4-49c9-b593-d223f7449a82 * Comments: Use a more precise check for disallowed keys on filtered comment data. The previous approach of running `wp_allow_comment()` twice could have unintended consequences, e.g. the `check_comment_flood` action was also triggered twice, which might lead to false-positive identification of comment flood in case there is some custom callback hooked to it, which is not expecting identical data seeing twice. This commit introduces a new function, `wp_check_comment_data()`, to specifically check for disallowed content before and after comment data is filtered. Follow-up to [59267]. Props david.binda, SergeyBiryukov. See #61827. git-svn-id: https://develop.svn.wordpress.org/trunk@59319 602fd350-edb4-49c9-b593-d223f7449a82 * Taxonomy: Remove count references from `WP_Term_Query`. Remove further documentation and a code reference to the unsupported `count` argument within `WP_Term_Query`. Follow up to [59261]. Props johnbillion. Fixes #61094 git-svn-id: https://develop.svn.wordpress.org/trunk@59325 602fd350-edb4-49c9-b593-d223f7449a82 * Tests/Build tools: Only fail importer tests if plugin is missing. Reverts an earlier change to the test suite in which the PHPUnit tests could not run if the importer plugin was not available. This update allows the test suite to run and will fail importer tests if the plugin is not available. Follow up to r59085. Props peterwilsoncc, azaozz. See #62325. git-svn-id: https://develop.svn.wordpress.org/trunk@59326 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Correct DocBlock formatting in `wp-includes/class-wp-theme-json.php`. Follow-up to [52049], [54118], [54162], [55008], [55349], [55959], [55986], [56058], [57496], [58354], [58413]. Props mukesh27, ramonopoly. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59328 602fd350-edb4-49c9-b593-d223f7449a82 * Help/About: Add images to the About page. Updates the images in the About page source with the final versions on the w.org CDN. Props ryelle, joen. See #61961. git-svn-id: https://develop.svn.wordpress.org/trunk@59329 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Update packages for 6.7 RC 3 Syncs `@wordpress/*` packages to the `wp-6.7` npm tag. Props kevin940726, ramonopoly, andrewserong. git-svn-id: https://develop.svn.wordpress.org/trunk@59330 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Correct `@param` tag in `untrailingslashit()` to match the parameter name. Follow-up to [54927]. Props justlevine. See #52217, #62281. git-svn-id: https://develop.svn.wordpress.org/trunk@59333 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Correct `@param` type in `fix_phpmailer_messageid()`. Follow-up to [48033]. Props justlevine. See #52217, #62281. git-svn-id: https://develop.svn.wordpress.org/trunk@59334 602fd350-edb4-49c9-b593-d223f7449a82 * Theme JSON: replace top-level background style objects on merge This commit fixes an omission in the logic of `WP_Theme_JSON::merge()` where top-level background image style objects are not replaced, rather they are merged. Because background images are self contained objects, their properties are unique and should not be merged. Blocks are already catered for via `WP_Theme_JSON::get_block_nodes()`. Follow-up to [61858]. Props ramonopoly, andrewserong. Fixes #62328. git-svn-id: https://develop.svn.wordpress.org/trunk@59335 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Add missing `void` to DocBlock `@return` types. This commit adds missing `void` return types to (parent) methods that can ''explicitly'' return `void` as one of their conditional paths. Addressed methods: * `WP_Privacy_Requests_Table::column_status()` * `WP_Recovery_Mode::handle_error()` * `WP_Widget::form()` — unlike the others, it's the ''child'' classes that return `void` when the method is correctly implemented. Note: `@return void` (where `void` is the single type returned) should not be used outside the default bundled themes and the PHP compatibility shims included in WordPress Core, as per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/ documentation standards]. Follow-up to [30382], [42967], [43256], [44973], [45448]. Props justlevine. See #52217, #62281. git-svn-id: https://develop.svn.wordpress.org/trunk@59336 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Explicitly return `false` in magic `__isset()` methods. This commit fixes an issue where some magic `__isset()` methods were potentially returning `void` (if the prop is not in an allow-listed array of fields) instead of an explicit boolean `false`. Addressed methods: * `WP_Comment::__isset()` * `WP_Query::__isset()` Follow-up to [28523], [31151], [34583], [34599]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59337 602fd350-edb4-49c9-b593-d223f7449a82 * Theme JSON Resolver: remove theme json merge in resolve_theme_file_uris This commit affects `WP_Theme_JSON_Resolver::resolve_theme_file_uris()`. When setting resolved URIs in an incoming theme json object, this commit removes the unnecessary call to `WP_Theme_JSON->merge()`. Why? `WP_Theme_JSON_Resolver::resolve_theme_file_uris()` only needs to set values for paths in the raw theme json object. It can then return a new theme object based on the updated JSON source. There's no need for a full and possibly expensive merge. Follow-up to [61588]. Props ramonopoly, aaronrobertshaw, andrewserong. Fixes #62329. git-svn-id: https://develop.svn.wordpress.org/trunk@59338 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Update packages for 6.7 RC 3 Syncs `@wordpress/*` packages to the `wp-6.7` npm tag. Props kevin940726, get_dave. Close #62321. git-svn-id: https://develop.svn.wordpress.org/trunk@59339 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Use explicit returns in `WP_Site_Health_Auto_Updates::test_*()`. This commit corrects several instances of `test_*()` methods potentially returning `void` instead of their documented return types. Since these methods are public, `null` is used to represent a passed test for backward compatibility with the coercion of the previously-returned `void`. Previous usage of `false` is preserved. Includes updating some `@return` tags for clarity. Follow-up to [44986], [46276], [49927]. Props justlevine, apermo, SergeyBiryukov. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59340 602fd350-edb4-49c9-b593-d223f7449a82 * Script Loader: Correct the number of arguments passed to `WP_Styles::get_etag()`. This fixes an issue with the usage of the new `$wp_styles->get_etag()` method in `wp-admin/load-styles.php`, where `$wp_version` is passed as the first argument instead of `$load` being used as the ''only'' argument. Follow-up to [58935]. Props justlevine, mukesh27, swissspidy. See #52217, #61485. git-svn-id: https://develop.svn.wordpress.org/trunk@59341 602fd350-edb4-49c9-b593-d223f7449a82 * Bundled Themes: Bump default theme versions for release with 6.7. This updates the version of each default theme to the following versions: * Twenty Ten: 4.3 * Twenty Eleven: 4.8 * Twenty Twelve: 4.4 * Twenty Thirteen: 4.3 * Twenty Fourteen: 4.1 * Twenty Fifteen: 3.9 * Twenty Sixteen: 3.4 * Twenty Seventeen: 3.8 * Twenty Nineteen: 3.0 * Twenty Twenty: 2.8 * Twenty Twenty-One: 2.4 * Twenty Twenty-Two: 1.9 * Twenty Twenty-Three: 1.6 * Twenty Twenty-Four: 1.3 These versions will released in coordination with WordPress 6.7. Props sh4lin, sabernhardt, mukesh27, chaion07. Fixes #62034. git-svn-id: https://develop.svn.wordpress.org/trunk@59344 602fd350-edb4-49c9-b593-d223f7449a82 * Media: Better variable name and some docs fixes for the new `wp_get_image_editor_output_format()`. Props peterwilsoncc, apermo, azaozz. See #62305. git-svn-id: https://develop.svn.wordpress.org/trunk@59346 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Update packages for 6.7 RC 3 Syncs @wordpress/* packages to the wp-6.7 npm tag. Props kevin940726, get_dave, youknowriad Close #62321. git-svn-id: https://develop.svn.wordpress.org/trunk@59347 602fd350-edb4-49c9-b593-d223f7449a82 * Bundled Themes: Update Twenty Twenty-Five for 6.7 RC 3. This merges the latest improvements to the Twenty Twenty-Five theme from GitHub into WordPress-Develop for 6.7 RC 3. A full list of changes can be found on GitHub: https://github.com/WordPress/twentytwentyfive/compare/b6f4ee2e5792c0818df0bdebca7dfdeaa016fa52...b5b0475f6a47daf9b650fa9cf6319284a1dea7d8. Props juanfra. See #62343. git-svn-id: https://develop.svn.wordpress.org/trunk@59348 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Update 3rd-party GitHub Actions. This updates the following GitHub Actions to their latest versions: - `wow-actions/welcome` - `actions/setup-node` - `actions/cache` See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59354 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Run test coverage when PHPunit workflow changes. [59287] updated the test coverage workflow to make use of the reusable PHPUnit workflow logic to prevent having duplicate code. The workflow should be run when the reusable file is updated to confirm any changes made work as expected. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59355 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Add script for generating code coverage report. This adds documentation for how to generate code coverage reports to the README.md file. `test:coverage` has also been added as an npm script to make it easier to generate a report using the local Docker environment. The script will generate an HTML, PHP, and text report file. Props pbearne, hellofromTonya, netweb. Fixes #53414. git-svn-id: https://develop.svn.wordpress.org/trunk@59356 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Use `WP_User_Query::get_results()` instead of a private property. This resolves an issue where the private property `WP_User_Query::$results` is accessed directly in `WP_REST_Users_Controller::get_items()` instead of via the `::get_results()` method. Follow-up to [38832]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59357 602fd350-edb4-49c9-b593-d223f7449a82 * Media: Fix variable name in `wp_check_filetype_and_ext()`. Props peterwilsoncc. See #62272. git-svn-id: https://develop.svn.wordpress.org/trunk@59358 602fd350-edb4-49c9-b593-d223f7449a82 * Performance: reuse block metadata in `WP_Theme_JSON::get_valid_block_style_variations()` In `WP_Theme_JSON::get_valid_block_style_variations()`, the method was calling `self::get_blocks_metadata()` even though the metadata was already retrieved in the parent function. This update reuses the existing block metadata instead of calling it again. A new optional parameter, `$blocks_metadata`, has been added to the function, allowing it to use pre-fetched metadata when available, improving efficiency. Fewer `self::get_blocks_metadata()` calls mean faster processing, especially in themes with many blocks. Props mukesh27, ramonopoly, aaronrobertshaw, flixos90. Fixes #62291. git-svn-id: https://develop.svn.wordpress.org/trunk@59359 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Correct the number of arguments for `WP_HTML_Tag_Processor::get_tag()`. This resolves an issue with `::get_tag()` being called in `WP_Block::replace_html()` with an extra argument, as the method accepts no arguments. Follow-up to [57514]. Props justlevine, mukesh27. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59361 602fd350-edb4-49c9-b593-d223f7449a82 * Bundled Themes: Sync some minor fixes for Twenty Twenty-Five. This merges several minor improvements to patterns in Twenty Twenty-Five. A full list of changes can be found on GitHub: https://github.com/WordPress/twentytwentyfive/compare/e7612e3cb31b7db9c43f5032a2cdcd79ed4a5cbf...b8c032e43c1101a5d57e07dd60768a326d44ac5c. Props juanfra. Fixes #62351. git-svn-id: https://develop.svn.wordpress.org/trunk@59362 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Improve private method name used by `WP_HTML_Processor::next_token()`. This renames the private `_next_token` method to `next_visitable_token`. It also removes irrelevant assertions from the unit test. Follow-up to [59285]. Props dmsnell, jonsurrell, westonruter. See #62269. git-svn-id: https://develop.svn.wordpress.org/trunk@59364 602fd350-edb4-49c9-b593-d223f7449a82 * Media: Only mark an image as requiring conversion if the output format differs from the input format. Follow up to [59317] and [59346]. Props adamsilverstein, peterwilsoncc. See #62305. git-svn-id: https://develop.svn.wordpress.org/trunk@59366 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Update packages for 6.7 RC 4 Syncs @wordpress/* packages to the wp-6.7 npm tag. Props get_dave, mikachan, gziolo, kevin940726, jonsurrell, jsnajdr git-svn-id: https://develop.svn.wordpress.org/trunk@59368 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Skip pull request comments for Dependabot. Currently, Dependabot is configured to open pull requests when updates to 3rd-party GitHub Actions become available. It does a great job at this. Thank you very much, 🤖 Mr. Dependabot Roboto. Some of the automated comments for pull requests are not relevant to PRs opened by Dependabot. Despite how good of a robot it is, Dependabot will never open a Trac ticket, so it's pointless to ask for one. Also, since it’s currently only configured to watch GitHub Actions for updates, there will never be a need to test Dependabot PRs in Playground. If instructed to monitor npm dependencies in the future, this comment can be added back as those packages can directly affect the built software that is distributed. Props johnbillion. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59370 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Ensure `$current` cookie time is `int` in `wp_user_settings()`. This addresses an issue where a string (`$current`) is compared to an integer (`$last_saved`). The issue is resolved by casting the results of `preg_replace()` to type `int` when `$current` is defined. Follow-up to [8784], [10083], [25109]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59373 602fd350-edb4-49c9-b593-d223f7449a82 * Help/About: Update the about page images for WordPress 6.7. Updates the about page images with more colourful imagery. Props sfougnier, fcoveram, Joen, davidbaumwald, ryelle. Fixes #61961. git-svn-id: https://develop.svn.wordpress.org/trunk@59374 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Remove unnecessary `isset()` from `xmlrpc.php`. This removes a redundant `isset( $HTTP_RAW_POST_DATA )` from `xmlrpc.php`, as the variable is already set in the code block immediately preceding the affected line. Follow-up to [3498], [5445], [47926]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59376 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Ensure cookie expiration value is an integer in `wp_update_user()`. This addresses an issue in `wp_update_user()`, where `time()` is subtracted from the `$logged_in_cookie['expiration']` of type `string`. Follow-up to [29043]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59377 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Add file header DocBlock for `wp-signup.php`. Follow-up to [https://mu.trac.wordpress.org/changeset/543 mu:543], [https://mu.trac.wordpress.org/changeset/557 mu:557], [12603]. Props jdahir0789, apermo, aboelfotoh. Fixes #62254. git-svn-id: https://develop.svn.wordpress.org/trunk@59378 602fd350-edb4-49c9-b593-d223f7449a82 * Media: Remove dimension suffix from full size converted HEIC images. Removes the dimension suffix, eg `-1000x1000` from the file name of full size images automatically converted from HEIC to JPEGs by WordPress. Introduces unit tests for the default conversion of images and customized conversion settings via the `image_editor_output_format` filter. Follow up to [58849], [58942], [59317], [59346], [59366] Props mukesh27, peterwilsoncc, azaozz, apermo, flixos90, ironprogrammer. Fixes #62359. See #53645, #62305. git-svn-id: https://develop.svn.wordpress.org/trunk@59379 602fd350-edb4-49c9-b593-d223f7449a82 * Media: Include image update missed in [59379]. "We missed you", hissed the lovecats. -- The Cure. See #62359. git-svn-id: https://develop.svn.wordpress.org/trunk@59380 602fd350-edb4-49c9-b593-d223f7449a82 * Feeds: Avoid fatal error with empty `blog_charset` value. After the SimplePie library was updated to version `1.8.0` in [59141], an edge case has been discovered where a fatal error can encountered if the `blog_charset` option is missing or empty. In `fetch_feed()`, this option is retrieved using `get_option()` instead of `get_bloginfo( ‘charset’ )`. The latter will detect this scenario and apply a default value of `UTF-8` and is already used interchangeably throughout Core. This switches to `get_bloginfo( ‘charset’ )` instead to prevent this edge case. Props david.binda, davidbaumwald, SergeyBiryukov, sabernhardt, azaozz, peterwilsoncc. Fixes #62354. git-svn-id: https://develop.svn.wordpress.org/trunk@59382 602fd350-edb4-49c9-b593-d223f7449a82 * Upgrade/Install: Update the `$_old_files` array for 6.7. Props pbiron, peterwilsoncc, fazyshah. Fixes #62150. git-svn-id: https://develop.svn.wordpress.org/trunk@59386 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Use `esc_url()` for comment author URL in Edit Comment form. Follow-up to [5543], [9436], [11104], [11204], [11739]. Props hiteshhuptechweb, sabernhardt. Fixes #62373. git-svn-id: https://develop.svn.wordpress.org/trunk@59388 602fd350-edb4-49c9-b593-d223f7449a82 * Mime Types: support uploading wav files in Firefox When uploading `wav` files in the editor, Chrome and other browsers identify the mime type of the file as `audio/wav`. Firefox, however, identifies the mime type as `audio/x-wav`. This commit updates the `'wav'` mime type key in `wp_get_mime_types()` to support `x-wav` so that uploading wav files work in Firefox. Previously, the editor reported an unsupported mime type error. Props imranh920, ramonopoly. Fixes #61948. git-svn-id: https://develop.svn.wordpress.org/trunk@59389 602fd350-edb4-49c9-b593-d223f7449a82 * Twenty Twenty: Correct the border style of the pull quote block in the editor. This change makes the border of the pull quote block visible in the editor when the user selects a border color or thickness, by setting the default border style to solid. Props nidhidhandhukiya, ugyensupport, dhruvang21, sabernhardt, divyeshk71, poena. Fixes #62301. git-svn-id: https://develop.svn.wordpress.org/trunk@59390 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Ensure that full processor can seek to earlier bookmarks. When the HTML Processor seeks to an earlier place, it returns the the beginning of the document and proceeds forward until it reaches the appropriate location. This requires resetting internal state so that the processor can correctly proceed from the beginning of the document. The seeking reset logic was not adapted to account for the full processor (i.e. when created via `WP_HTML_Processor::create_full_parser()`). This change updates the seek logic to account for the full and fragment parsers as well as other state that has been introduced in the interim and should be reset. Props jonsurrell, dmsnell, westonruter, mi5t4n. Fixes #62290. git-svn-id: https://develop.svn.wordpress.org/trunk@59391 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Expect closer on foreign content `void` lookalike elements. Ensure that `expects_closer` returns `false` on tags that look like void HTML tags, but are actually ''not'' void tags in foreign content. Props jonsurrell, bernhard-reiter. Fixes #62363. git-svn-id: https://develop.svn.wordpress.org/trunk@59392 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Prevent orphaned Docker containers. This updates certain local Docker environment commands to include `--rm`, which instructs `docker compose` to remove the container after running the specified scripts. Previously only the installation script contained `--rm`. But running `test:php`, `env:start`, or `env:cli` resulted in the container remaining. Props johnbillion. Fixes #62395. git-svn-id: https://develop.svn.wordpress.org/trunk@59393 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Run upgrade tests against 6.7. Now that 6.7 is generally available, the upgrade tests no longer need to be run against a pre-release version. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59397 602fd350-edb4-49c9-b593-d223f7449a82 * Interactivity API: Allow missing state negation on server Aligns on the behavior of the negation operator with directives to missing paths in client and in server. With a directive like the following: {{{ <div data-wp-bind--hidden="!state.missing.property"> This should be hidden by the <code>hidden</code> attribute. </div> }}} Both server and client will return with this fix: {{{ <div data-wp-bind--hidden="!state.missing.property" hidden=""> This should be hidden by the <code>hidden</code> attribute. </div> }}} Props jonsurrell, luisherranz. Fixes #62374. git-svn-id: https://develop.svn.wordpress.org/trunk@59398 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Include doctype in full parser serialize. Output DOCTYPE when calling `WP_HTML_Processor::serialize` on a full document that includes a DOCTYPE. The DOCTYPE should be included in the serialized/normalized HTML output as it has an impact in how the document is handled, in particular whether the document should be handled in quirks or no-quirks mode. This only affects the serialization of full parsers at this time because DOCTYPE tokens are currently ignored in all possible fragments. The omission of the DOCTYPE is subtle but can change the serialized document's quirks/no-quirks mode. Props jonsurrell. Fixes #62396. git-svn-id: https://develop.svn.wordpress.org/trunk@59399 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Consistently escape URLs in `wp-admin/themes.php`. Includes: * Wrapping long lines for better readability. * Bringing some consistency to the placement of `href` and `aria-label` attributes. * Adding missing `aria-label` attributes for Live Preview links. Follow-up to [26726], [52020], [51083]. Props patelketan, sainathpoojary, SergeyBiryukov. Fixes #62405. git-svn-id: https://develop.svn.wordpress.org/trunk@59400 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Avoid starting the database twice. The database container is started when the `services` are initially set up. Having a separate step for this sometimes introduces unexpected failures for an unknown reason. Props johnbillion. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59402 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Correct upgrade testing workflow name. The reusable upgrade testing workflow was renamed in [58165], but the event `paths` filters were not updated accordingly. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59403 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Correct the spelling of silicon in the local development environment readme. See #62281 git-svn-id: https://develop.svn.wordpress.org/trunk@59405 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Add missing commas in a few DocBlocks for various media functions. Follow-up to [56416]. Props truptikanzariya. Fixes #62433. git-svn-id: https://develop.svn.wordpress.org/trunk@59406 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Escape attachment URL in `wp-admin/async-upload.php`. Follow-up to [58279]. Props shyamkariya, pitamdey, nareshbheda, ketanniruke, desrosj. Fixes #62434. git-svn-id: https://develop.svn.wordpress.org/trunk@59407 602fd350-edb4-49c9-b593-d223f7449a82 * Tests: Add missing `@covers` tag for `fetch_feed()` tests. Includes correcting the test class name as per the naming conventions. Follow-up to [59382]. See #62280. git-svn-id: https://develop.svn.wordpress.org/trunk@59408 602fd350-edb4-49c9-b593-d223f7449a82 * Customizer: Fix layout issues in customizer accordions. Adjust some CSS characteristics in the customizer accordions to avoid a slight horizontal scroll, allow the chevron icon to be part of the clickable control surface, and resolve a pre-existing padding issue allowing overflow on accordion headings. Follow up to [59224]. Props laurelfulford, wildworks, domainsupport, sabernhardt, rcreators, desrosj, sainathpoojary. Fixes #62313, #62335. git-svn-id: https://develop.svn.wordpress.org/trunk@59409 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Fix normalized doctype pub/sys identifier quotes. Changeset [59399] fixed missing DOCTYPEs in normalized HTML output. It missed an edge case where public and system identifiers may contain double quotes, in which case they must be quoted with single quotes. This commit addresses that issue and adds tests. Follow-up to [59399]. Props jonsurrell, luisherranz, apermo. Fixes #62396. git-svn-id: https://develop.svn.wordpress.org/trunk@59410 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Use sentence casing for “Call to action”. This is more consistent with other strings and occurrences of this string. Props juanfra, joen, narenin, mukesh27. See #62414. git-svn-id: https://develop.svn.wordpress.org/trunk@59412 602fd350-edb4-49c9-b593-d223f7449a82 * Media: Avoid running expensive logic twice using GD. Support for uploading AVIF was added in [57524]. A new block of conditional logic was added determine which function should be used to create the new image file that resulted in these expensive functions being run twice. This combines the two conditional logic to ensure the appropriate function is only run once regardless of format. Props adamsilverstein, glynnquelch. Fixes #62331. git-svn-id: https://develop.svn.wordpress.org/trunk@59413 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Fix the JS to select, save, and update categories on the old Edit Post screen. Props: charleslf, im3dabasia1, desrosj, dhruvang21, Zargarov, sainathpoojary, azaozz Fixes: #62440 git-svn-id: https://develop.svn.wordpress.org/trunk@59414 602fd350-edb4-49c9-b593-d223f7449a82 * Media: Avoid images with `sizes=auto` to be displayed downsized in supporting browsers. Based on the user agent stylesheet rules outlined in https://html.spec.whatwg.org/multipage/rendering.html#img-contain-size, images that have `sizes=auto` while applying `width: auto` or `width: fit-content` would be constrained to only 300px width. This changeset overrides said user agent stylesheet rule with a much larger constraint, to avoid the problem. Additionally, it introduces a filter `wp_img_tag_add_auto_sizes` which can be used to opt out of the functionality, as an additional measure. Props joemcgill, flixos90, dooperweb, SirLouen, azaozz, mukesh27, apermo. Fixes #62413. See #61847, #62345. git-svn-id: https://develop.svn.wordpress.org/trunk@59415 602fd350-edb4-49c9-b593-d223f7449a82 * Interactivity API: Remove redundant server state from Interactivity Router Remove the workaround for a bug that was fixed in https://github.com/WordPress/gutenberg/pull/66183. Previously, if the store was not initialized with a minimal navigation object, the interactivity-router script module would error. Props jonsurrell, czapla, gziolo. Fixes 62465#. git-svn-id: https://develop.svn.wordpress.org/trunk@59416 602fd350-edb4-49c9-b593-d223f7449a82 * Users: Correct “Add New User” page reference on Network Settings screen. Follow-up to [56515]. Props timse201. Fixes #62458. git-svn-id: https://develop.svn.wordpress.org/trunk@59417 602fd350-edb4-49c9-b593-d223f7449a82 * Theme JSON: include block style variations in path only output of get_block_nodes An `$include_node_paths_only` option to `get_block_nodes()` was introduced to improve performance. When set to `true`, this option tells the function to only return paths, and not selectors, for consumers that only needed paths to style values. For one of the conditional blocks, block style variations wasn't included. This commit adds them to the array of paths following the existing model `$node[]['path' => [], 'variations' => ['path' => []]]`. Follow-up to [61858]. Props aaronrobertshaw, ramonopoly. Fixes #62399. git-svn-id: https://develop.svn.wordpress.org/trunk@59418 602fd350-edb4-49c9-b593-d223f7449a82 * Admin Color Scheme: Update the highlight color in the Modern color scheme. In the Modern color scheme, the font color on hover in the admin bar is bright green. However, in the WordPress.org site itself, the color used is Blueberry 2. This commits aligns both colors on the more balanced Blueberry color. Props fushar, Joen. Fixes #62219. git-svn-id: https://develop.svn.wordpress.org/trunk@59419 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Use case insensitive tag_name comparison in `::next_tag`. The HTML API `::next_tag` method now performs case-insensitive matching when searching for tags by name. For example, searching for 'DIV' will match both '<div>' and '<DIV>' tags. Props jonsurrell, dmsnell. Fixes #62427. git-svn-id: https://develop.svn.wordpress.org/trunk@59422 602fd350-edb4-49c9-b593-d223f7449a82 * Login: Revert selector change in login heading CSS. In [59138], the login screens were updated to change the `h1` heading from the logo to screen-reader hidden text. Along with that HTML change, we changed the CSS selectors from `.login h1` to `.login .wp-login-logo`. This unnecessary change increased specificity and broke the CSS selectors used by a wide variety of plugins to replace the login logo. Commit reverts the change in selector back to using the `.login h1` pattern. Props leecollings, sabernhardt, im3dabasia1, roytanck, sailpete, joedolson. Fixes #62410. git-svn-id: https://develop.svn.wordpress.org/trunk@59424 602fd350-edb4-49c9-b593-d223f7449a82 * Toolbar: Allow the Learn WordPress link to be localized. The Learn WordPress website is supposed to automatically redirect to the correct locale according to the browser's language settings, however that may not work as expected in some cases. This commit brings consistency with the other WordPress.org links, which can be localized as appropriate. Follow-up to [56720]. Props timse201, ruturajraval2305, yogeshbhutkar, ajayghaghretiya-multidots, swissspidy, sabernhardt, im3dabasia1, mukesh27. Fixes #62459. git-svn-id: https://develop.svn.wordpress.org/trunk@59425 602fd350-edb4-49c9-b593-d223f7449a82 * Menus: i18n: Fix untranslatable strings in `nav-menu.js`. Wrap three untranslatable strings in nav menus in JS translation functions. Follow up to [59265]. Props juliemoynat, swissspidy, yogeshbhutkar, sergeybiryukov, desrosj, tobifjellner, audrasjb, joedolson. Fixes #62402. git-svn-id: https://develop.svn.wordpress.org/trunk@59426 602fd350-edb4-49c9-b593-d223f7449a82 * Options, Meta APIs: Ensure duplicate salts are properly flagged. Improvements were made in 6.7 to ensure that salts stored in the database were primed more efficiently. The logic added to accomplish this suffered from an edge case where array indexes were unexpectedly missing when `wp_salt()` was called recursively. Follow up to [58837]. Props juliobox, ankitkumarshah, dilipbheda, johnbillion, joemcgill, desrosj. Fixes #62424. git-svn-id: https://develop.svn.wordpress.org/trunk@59427 602fd350-edb4-49c9-b593-d223f7449a82 * i18n: Account for `load_*_textdomain()` after JIT loading. When `load_*_textdomain()` functions are called after WordPress has already attempted just-in-time loading of translations, nothing happens. This updates the related logic to retry translation loading when a custom path is set to ensure all translations are available. Additionally, this also fixes cases where an `en_US.mo` file is provided with non-English strings to override the default language. Follow up to [59157]. Props swissspidy, peterwilsoncc, desrosj, apermo, sergeybiryukov, wildworks, tigriweb, twvania, looswebstudio, stimul, audrasjb, finntown, bluantinoo, timwhitlock, albigdd. See #62337. git-svn-id: https://develop.svn.wordpress.org/trunk@59430 602fd350-edb4-49c9-b593-d223f7449a82 * I18N: Adjust translator comments in `nav-menu.js`. Includes: * Moving the comments directly above `wp.i18n._x()` so that they can be picked up properly. * Simplifying the context to avoid unnecessarily translating the string twice for the same use case. * Using the established translator comments format for consistency. Follow-up to [59428]. See #62402. git-svn-id: https://develop.svn.wordpress.org/trunk@59431 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: update npm packages in trunk for 6.7.1. Syncs Editor packages for WordPress 6.7.1 RC1. Includes the following PRs: - https://github.com/WordPress/gutenberg/pull/66945 - https://github.com/WordPress/gutenberg/pull/66889 - https://github.com/WordPress/gutenberg/pull/67139 Reviewed by desrosj. Merges [59437] to trunk. Props mmaattiiaass, ramonopoly, mamaduka, get_dave, poena, ntsekouras, mcsf, jsnajdr, 0mirka00, desrosj, joemcgill, cbravobernal, azaozz, room34, mayanktripathi32, im3dabasia1, jonsurrell. Fixes #62478, #62447. git-svn-id: https://develop.svn.wordpress.org/trunk@59438 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Correctly check for Dependabot. This updates the conditions added in [59370] to skip unnecessary pull request comments when Dependabot is the opening contributor to check for the correct `github.actor` value. Follow up to [59380]. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59441 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Avoid unnecessary array_merge in WP_Style_Engine::parse_block_styles(). This adds an `! empty()` check for classnames and declarations to avoid calling array_merge() with an empty value. Props mukesh27, ramonopoly, aaronrobertshaw. Fixes #62317. git-svn-id: https://develop.svn.wordpress.org/trunk@59442 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Improve the error message shown when fetching Twemoji fails. This allows the full error message to be shown from the connection attempt instead of a generic error message. Fixes #62382 git-svn-id: https://develop.svn.wordpress.org/trunk@59443 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Add method to create fragment at node. HTML Fragment parsing always happens with a context node, which may impact how a fragment of HTML is parsed. HTML Fragment Processors can be instantiated with a `BODY` context node via `WP_HTML_Processor::create_fragment( $html )`. This changeset adds a static method called `create_fragment_at_current_node( string $html_fragment )`. It can only be called when the processor is paused at a `#tag`, with some additional constraints: - The opening and closing tags must appear in the HTML input (no virtual tokens). - No "self-contained" elements are allowed ( `IFRAME`, `SCRIPT`, `TITLE`, etc.). If successful, the method will return a `WP_HTML_Processor` instance whose context is inherited from the node that the method was called from. Props jonsurrell, bernhard-reiter, gziolo. Fixes #62357. git-svn-id: https://develop.svn.wordpress.org/trunk@59444 602fd350-edb4-49c9-b593-d223f7449a82 * Bundled Theme: Pin a `theme.json` schema version to Twenty Twenty-Five. Each theme’s `theme.json` schema version should be pinned to the version that was valid at the time it was released. Props im3dabasia1, poena, mukesh27. Fixes #62455. git-svn-id: https://develop.svn.wordpress.org/trunk@59448 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Warn about empty templates on the frontend for logged in users. Adds a new function, `wp_render_empty_block_template_warning`, that renders a warning for logged-in users when a block template is empty. Reviewed by get_dave, richtabor. Props vcanales, mikachan, peterwilsoncc, richtabor, get_dave, mrfoxtalbot, matveb, arielmaidana, seifradwane, annezazu. Fixes #62053. git-svn-id: https://develop.svn.wordpress.org/trunk@59449 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Prevent fragment creation on close tag. Prevent fragments from being created at tag closers. Follow-up to [59444]. Props jonsurrell, bernhard-reiter. Fixes #62357. git-svn-id: https://develop.svn.wordpress.org/trunk@59450 602fd350-edb4-49c9-b593-d223f7449a82 * Bundled Theme: Pin schema version to rest of Twenty Twenty-Five. All JSON files in the theme should be pinned to the appropriate schema version, not just `theme.json`. Follow up to [59448]. Props im3dabasia1, poena. Fixes #62455. git-svn-id: https://develop.svn.wordpress.org/trunk@59451 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Create reusable workflow for parsing `.version-support-*.json` files. This extracts the logic responsible for parsing the `.version-support-*.json` files and returning a list of supported PHP and MySQL versions for a given branch of WordPress into a reusable workflow so that other workflows can make use of the functionality without repeating code. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59452 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Explicitly return `null` instead of coercing `void`. This addresses two instances where a function that is documented as returning `{someType}|null` doesn't explicitly return `null`. Affected functions: * `array_key_first()` * `WP_REST_Posts_Controller::handle_terms()` Follow-up to [38832], [52038]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59453 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Fix selecting/deselecting multiple unwanted categories when clicking on a Category checkbox on the old Edit Post screen. Props ffffelix, desrosj, ironprogrammer, neotrope, narenin, zaoyao, im3dabasia1, cbravobernal, azaozz. Fixes #62504. git-svn-id: https://develop.svn.wordpress.org/trunk@59454 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Replace usage of deprecated `wp_get_duotone_filter_svg()`. This updates `WP_Theme_JSON::get_svg_filters()` to use `WP_Duotone::get_filter_svg_from_preset()` instead of the `wp_get_duotone_filter_svg()` function, deprecated in WordPress 6.3. Follow-up to [52757], [56101]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59455 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Remove extra `unset()` in `rest_handle_options_request()`. `$args` is defined in the immediately preceding code block, and only contains non-integer keys, so there is never an `$args[0]` to unset. Follow-up to [44933]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59456 602fd350-edb4-49c9-b593-d223f7449a82 * REST API: Remove trailing slashes when preloading requests and there is a query string. Follow-up to [51648], see #51636. Props antonvlasenko, swissspidy, spacedmonkey. Fixes #57048. git-svn-id: https://develop.svn.wordpress.org/trunk@59457 602fd350-edb4-49c9-b593-d223f7449a82 * REST API: Terms: Respect taxonomy's default query args. It is possible to supply a set of default query `args` to `register_taxonomy()` which will be used when querying a list of terms -- for example, `orderby` in order to specify how the resulting list of terms should be sorted. The Terms REST API controller previously respected these default query args only if the request included a post ID. This changeset makes it so that the default args will also be respected if no post ID is provided. Props bernhard-reiter, jsnajdr. Fixes #62500. git-svn-id: https://develop.svn.wordpress.org/trunk@59458 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Cast `$expired` to an integer in `wp_validate_auth_cookie()`. This resolves an issue where the string `$expired` value is used both in a comparison and addition with integer values. Follow-up to [6387], [28424], [45590]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59459 602fd350-edb4-49c9-b593-d223f7449a82 * I18N: Switch locale to admin locale when sending auto update emails. If sending an auto update email to the site administrator's email address, look up if a user with the same email exists and switch to that user's locale. If not, explicitly switches to the site locale. This is a follow-up to [59128] where this was previously added for other types of emails. Props benniledl, swissspidy. Fixes #62496. git-svn-id: https://develop.svn.wordpress.org/trunk@59460 602fd350-edb4-49c9-b593-d223f7449a82 * I18N: Load translations just-in-time for custom themes and plugins. In #34114, just-in-time (JIT) translation loading was implemented for projects hosted on WordPress.org. This is now expanded to all other plugins/themes. Projects with a custom `Text Domain` and `Domain Path` header no longer need to call `load_plugin_textdomain()` or `load_theme_textdomain()`. This reduces the risk of calling them too late, after some translation calls already happened, and generally makes it easier to properly internationalize a plugin or theme. This moves the `get_plugin_data()` from `wp-admin/includes/plugin.php` to `wp-includes/functions.php` so it's available during the plugin loading process. Props swissspidy. Fixes #62244. git-svn-id: https://develop.svn.wordpress.org/trunk@59461 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Cast `wp_count_terms()` result to `int` before using in `ceil()`. This addresses two instances of the (numeric string) return value from `wp_count_terms()` being used directly in `ceil()`, which expects an `int|float`. Affected methods: * `WP_Sitemaps_Taxonomies::get_max_num_pages()` * `wp_nav_menu_item_taxonomy_meta_box()` Reference: [https://www.php.net/manual/en/function.ceil.php PHP Manual: ceil()]. Follow-up to [14248], [14291], [14569], [14943], [48072], [57648]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59462 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Remove unused processor state context_node property The HTML Processor State `context_node` is redundant and can be deprecated. The property has been superseded by `WP_HTML_Processor->context_node` since [58304]. Props jonsurrell, gziolo. Fixes #62518. git-svn-id: https://develop.svn.wordpress.org/trunk@59463 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Recognize all uppercase tag names in tag processor. Fixes a missing "D" in the character list used by strspn to find tag openers, causing tags starting with D to be skipped by the tag processor in some circumstances. Follow-up to [58613]. Props jonsurrell, santosguillamot, wongjn, cbravobernal. Fixes #62522. git-svn-id: https://develop.svn.wordpress.org/trunk@59464 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Cast `gmdate( 'Z' )` to an integer before addition. This addresses two instances of the (numeric string) `gmdate( 'Z' )` being added to an `int` value. Affected functions: * `upgrade_110()` * `WP_Date_Query::validate_date_values()` Follow-up to [942], [29925], [45424]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59465 602fd350-edb4-49c9-b593-d223f7449a82 * I18N: Do not reuse `$theme` variable name after loading a theme's `functions.php` file. The file could declare its own `$theme` variable, which would override the one used in the `foreach` loop. To prevent this, call `wp_get_theme()` before loading the file and store the instance in a different variable. Props neo2k23, swissspidy. See #62244. git-svn-id: https://develop.svn.wordpress.org/trunk@59466 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Allow more contexts in `create_fragment`. This changeset modifies `WP_HTML_Processor::create_fragment( $html, $context )` to use a full processor and `create_fragment_at_node` instead of the other way around. This makes more sense and makes the main factory methods more clear, where the state required for fragments is set up in `create_fragment_at_node` instead of in both `create_fragment` and `create_fragment_at_current_node`. This allows for more HTML contexts to be provided to the basic `create_fragment` where the provided context HTML is appended to `<!DOCTYPE html>`, a full processor is created, the last tag opener is found, and a fragment parser is created at that node via `create_fragment_at_current_node`. The HTML5lib tests are updated accordingly to use this new method to create fragments. Props jonsurrell, dmsnell, bernhard-reiter. Fixes #62584. git-svn-id: https://develop.svn.wordpress.org/trunk@59467 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Make non-body fragment creation methods private. The current implementation of `create_fragment` (and the underlying `create_fragment_at_current_node`) allows passing in a context that might result in a tree that cannot be represented by HTML. For example, a user might use `<p>` as context, and attempt to create a fragment that also consists of a paragraph element, `<p>like this`. This would result in a paragraph node nested inside another -- something that can never result from parsing HTML. To prevent this, this changeset makes `create_fragment_at_current_node` private and limits `create_fragment` to only `<body>` as context, while a comprehensive solution to allow other contexts is being worked on. Follow-up to [59444], [59467]. Props jonsurrell, dmsnell, bernhard-reiter. Fixes #62584. git-svn-id: https://develop.svn.wordpress.org/trunk@59469 602fd350-edb4-49c9-b593-d223f7449a82 * Twenty-Twenty: Fixes space between post content on front. The post author and post date did not have space between them and the post content. This brings in 1em of top margin. Of note is that this only is if the first element is a paragraph that the issue was caused. Props abcd95, sabernhardt, desrosj, sainathpoojary, viralsampat. Fixes #62243. git-svn-id: https://develop.svn.wordpress.org/trunk@59470 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Cast `gmdate( 'w' )` to `int` before using as integer. This addresses several instances of `gmdate( 'w' )` being used directly as an integer, when it's actually a numeric string. The issue is remediated by casting the value to `int` before use. Affected functions: * `get_calendar()` * `get_weekstartend()` Follow-up to [508], [1632]. Props justlevine. See #52217. git-svn-id: https://develop.svn.wordpress.org/trunk@59471 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Add description for Banners block pattern category. Follow-up to [55098]. Props parinpanjari, youknowriad, Joen, dhruvang21, apermo, mukesh27. Fixes #62115. git-svn-id: https://develop.svn.wordpress.org/trunk@59472 602fd350-edb4-49c9-b593-d223f7449a82 * Media: improve filter to enable setting output quality by image size. Add a new $size parameter to the wp_editor_set_quality filter. $size is an array with 'width' and 'height' keys. Developers can use this information to set image quality based on the image size. Props adamsilverstein, joemcgill, Mte90, codekraft, birgire, azaozz, sppramodh. Fixes #54648. git-svn-id: https://develop.svn.wordpress.org/trunk@59473 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Correct DocBlock formatting for `WP_Theme_JSON::FONT_FAMILY_SCHEMA`. Follow-up to [57496]. Props marian1. Fixes #62621. git-svn-id: https://develop.svn.wordpress.org/trunk@59474 602fd350-edb4-49c9-b593-d223f7449a82 * Date/Time: Add `d.m.Y` to date format presets on General Settings screen. This gives users another option when selecting how dates are displayed on their site. This change is relevant for better localization, providing more date format choices for users in regions where this format is common. The `array_unique()` call ensures that if this format was already added by a plugin or theme, it won't be duplicated. Follow-up to [9131], [22299], [28820], [28848]. Props Daedalon, pbearne, fierevere, im3dabasia1, SergeyBiryukov. Fixes #55685. git-svn-id: https://develop.svn.wordpress.org/trunk@59475 602fd350-edb4-49c9-b593-d223f7449a82 * Twenty Thirteen & Twenty Sixteen: Correct the border of the latest comments block in the editor. This change hides the top border of the first comment in the latest comments block, so that the design in the editor and the front looks the same. Props viralsampat, sabernhardt, aishwarryapande, parthvataliya, imranhasanraaz. Fixes #62282. git-svn-id: https://develop.svn.wordpress.org/trunk@59476 602fd350-edb4-49c9-b593-d223f7449a82 * Interactivity API: Support length property on strings and arrays on the server The Interactivity API tries to align client and server rendering so that the behavior is the same. Adds missing handling for `.length` to directives processing on the server on strings and numeric arrays which is inherently supported through JavaScript language on the client. Props jonsurrell, gziolo, luisherranz. Fixes #62582. git-svn-id: https://develop.svn.wordpress.org/trunk@59477 602fd350-edb4-49c9-b593-d223f7449a82 * I18N: Load admin translations for auto update emails. As a follow-up to [59460], make sure that admin strings are loaded when switching locales for auto update notification emails, as those strings are in a separate translation file. Props benniledl, swissspidy. Fixes #62496. git-svn-id: https://develop.svn.wordpress.org/trunk@59478 602fd350-edb4-49c9-b593-d223f7449a82 * Plugins: Make more plugin-related functions available early on. This is a follow-up to [59461], which moved `get_plugin_data()` from `wp-admin/includes/plugin.php` to `wp-includes/functions.php` so it's available during the plugin loading process. Related functions like `is_plugin_active()` are often used together and should therefore be moved as well, to improve backward compatibility for plugins which load `wp-admin/includes/plugin.php` only conditionally. Props johnbillion, dd32, swissspidy. See #62244. git-svn-id: https://develop.svn.wordpress.org/trunk@59479 602fd350-edb4-49c9-b593-d223f7449a82 * Customize: Begin HTML markup before Customizer script hooks. This prevents printing styles and scripts before the `<!DOCTYPE>`. The `_wp_admin_html_begin()` function should precede Customizer script hooks, in case a plugin prints markup inside a hook such as `admin_enqueue_scripts`. Follow-up to [19995], [27907]. Props sabernhardt. Fixes #62629. git-svn-id: https://develop.svn.wordpress.org/trunk@59480 602fd350-edb4-49c9-b593-d223f7449a82 * External Libraries: Upgrade PHPMailer to version 6.9.3. This is a maintenance release, adding support for the release version of PHP 8.4, and experimental support for PHP 8.5. References: * [https://github.com/PHPMailer/PHPMailer/releases/tag/v6.9.3 PHPMailer 6.9.3 release notes] * [https://github.com/PHPMailer/PHPMailer/compare/v6.9.2...v6.9.3 Full list of changes in PHPMailer 6.9.3] Follow-up to [50628], [50799], [51169], [51634], [51635], [52252], [52749], [52811], [53500], [53535], [53917], [54427], [54937], [55557], [56484], [57137], [59246]. Props desrosj, yogeshbhutkar, ayeshrajans. Fixes #62632. git-svn-id: https://develop.svn.wordpress.org/trunk@59481 602fd350-edb4-49c9-b593-d223f7449a82 * Block Hooks: Fix context in `update_ignored_hooked_blocks_postmeta`. Ensure that the `$context` arg passed from `update_ignored_hooked_blocks_postmeta` to `apply_block_hooks_to_content` (and from there, to filters such as `hooked_block_types` and `hooked_block`) has the correct type (`WP_Post`). Filters hooked to `hooked_block_types` etc can typically include checks that conditionally insert a hooked block depending on `$context`. Prior to this changeset, a check like `if ( $context instanceof WP_Post )` would incorrectly fail, as `$context` would be a `stdClass` instance rather than a `WP_Post`. As a consequence, a hooked block inside of a Navigation post object that was modified by the user would not be marked as ignored by `update_ignored_hooked_blocks_postmeta`, and thus be erroneosly re-inserted by the Block Hooks algorithm. Props bernhard-reiter. Fixes #62639. git-svn-id: https://develop.svn.wordpress.org/trunk@59482 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Add `repository` input to support JSON reading workflow. `actions/checkout` will always checkout the current repository unless the `repository` input is specified. This updates the `reusable-support-json-reader-v1.yml` workflow to always default to reading the JSON files from `wordpress-develop`. A `repository` has also been added to the workflow to allow a different set of JSON files to be read if desired. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59483 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Support older MariaDB versions in local Docker environment. Older versions of MariaDB did not contain the `mariadb-admin` command. This command is configured as the `healthcheck` used by the local Docker environment to confirm that the database container has successfully started and is reporting as “healthy”. The current result is a failure when starting the environment while using one of the affected older versions. For MariaDB versions 10.3 and earlier, the `mysqladmin` command was used instead. Since WordPress still technically supports back to MariaDB 5.5, the local environment should support running these versions. This updates the environment configuration to take this into account when performing a `healthcheck` test. The README file is also updated to reflect that the same workaround added in [57568] for MySQL <= 5.7 is required when using MariaDB 5.5 on an Apple silicon machine. Props johnbillion. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59484 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Run install tests when JSON reading workflow is changed. Because the installation testing workflow relies on the reusable workflow that reads the JSON support files, it should be run when that file is changed to confirm there are no issues. This is currently only configured for `pull_request` events, but should also be true for `push`. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59485 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Remove blank line at the end of `wp_prepare_attachment_for_js()` DocBlock. Follow-up to [21680], [49281]. Props nareshbheda. Fixes #62642. git-svn-id: https://develop.svn.wordpress.org/trunk@59486 602fd350-edb4-49c9-b593-d223f7449a82 * Plugins: Load `wp-admin/includes/plugin.php` earlier. Partially reverts [59479] and [59461], which previously tried to move some functions from `wp-admin/includes/plugin.php` to `wp-includes/functions.php` so they are available early, so that `get_plugin_data()` can be used. However, other functions from that file are often used by plugins without necessarily checking whether they are available, easily causing fatal errors. Requiring this file directly is a safer approach to avoid such errors. Props peterwilsoncc, dd32, swissspidy, johnbillion. Fixes #62244. git-svn-id: https://develop.svn.wordpress.org/trunk@59488 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Properly escape `$` characters in Docker compose file. This fixes an invalid interpolation format error that can be encountered in the `mysql` container’s healthcheck test command. Follow up to [59484]. Props afercia. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59489 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Use newer versions for `include` jobs. The `include` part of the strategy for the PHPUnit testing workflow defines a few testing configurations outside of the matrix. The versions of PHP and MySQL used in these have not been updated for some time. This was mostly due to various incompatibilities that have since been resolved. Props peterwilsoncc, johnbillion. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59490 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Support `trunk` as a version. `trunk` is used interchangeably with `nightly`, so should be an accepted value when determining which version of WordPress is being tested. Follow up to [59452], [59483]. Props johnbillion. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59491 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Introduce workflow for testing the local Docker environment. While the PHPUnit workflow currently relies on the local Docker environment and provides some safety checks that the environment works as expected, this may not always be true and does not test all of the available commands related to the environment. This introduces a basic workflow for testing the related scripts for the various supported combinations of PHP and database software with the environment to confirm everything is working as expected. Ideally this would also be run on Windows and MacOS to catch platform specific bugs. Unfortunately, Docker is not supported within the GitHub Action runner images, so not all bugs will be caught by this workflow. Props johnbillion, Clorith. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59492 602fd350-edb4-49c9-b593-d223f7449a82 * Embeds: ensure correct thumbnail height. Use height 0 instead of 9999 to avoid unnecessarily using the full size version. Props colinleroy, swissspidy. Fixes #62094. git-svn-id: https://develop.svn.wordpress.org/trunk@59493 602fd350-edb4-49c9-b593-d223f7449a82 * I18N: Add new `WP_Locale::get_month_genitive()` method. Complements existing helper methods such as `WP_Locale::get_month_abbrev()`. Props ankitkumarshah, Tkama, SergeyBiryukov. Fixes #58658. git-svn-id: https://develop.svn.wordpress.org/trunk@59494 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Add missing `@var` tag for `WP_Query::$query_vars_changed`. Follow-up to [17552]. Props marian1, jigar-bhanushali, martin.krcho, parthvataliya. Fixes #62022. git-svn-id: https://develop.svn.wordpress.org/trunk@59495 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Use correct escaping function for `wp_http_referer`. Follow-up to [58069]. Props yogeshbhutkar, sainathpoojary, PcTevree, knutsp, siliconforks, stromhalm, shanemuir. Fixes #62551. git-svn-id: https://develop.svn.wordpress.org/trunk@59496 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Use strict comparison in `media_upload_form_handler()`. Follow-up to [10390]. Props deepakrohilla, iflairwebtechnologies, mukesh27, dingguodong, aristath. Fixes #62009. git-svn-id: https://develop.svn.wordpress.org/trunk@59497 602fd350-edb4-49c9-b593-d223f7449a82 * Coding Standards: Use strict comparison in `wp-includes/comment-template.php`. Follow-up to [162], [2685], [4494], [8878], [8961], [55660]. Props aristath, poena, afercia, SergeyBiryukov. See #62279. git-svn-id: https://develop.svn.wordpress.org/trunk@59498 602fd350-edb4-49c9-b593-d223f7449a82 * Editor: Update docblocks for `wp_get_global_stylesheet` and `WP_Theme_JSON::get_stylesheet`. Updates docblocks to account for new use of the `custom-css` string in their `$types` parameters and adds information to deprecation of `wp_get_global_styles_custom_css`. Props justlevine, isabel_brison, ramonopoly. Fixes #62665. git-svn-id: https://develop.svn.wordpress.org/trunk@59499 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Step past closing HTML, BODY tags The HTML specification does not close HTML or BODY tags (pop them off the stack of open elements) when their tag closers are encountered. The HTML processor correctly handled this behavior, however it incorrectly "paused" by returning true from the step functions. Props jonsurrell, dmsnell, gziolo. Fixes #62583. git-svn-id: https://develop.svn.wordpress.org/trunk@59500 602fd350-edb4-49c9-b593-d223f7449a82 * REST API: Correct description for the `humanized_updated` block directory property. Follow-up to [48242], [51676]. Props mujuonly, mukesh27. Fixes #62667. git-svn-id: https://develop.svn.wordpress.org/trunk@59501 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Prevent bookmarks from being set on virtual tokens Fixes the issue when an HTML_Processor bookmark was set at a virtual token (a node in the resulting document that does not correspond to an HTML token present in the input string), seek behavior was unreliable. Props jonsurrell, gziolo. Fixes #62521. git-svn-id: https://develop.svn.wordpress.org/trunk@59502 602fd350-edb4-49c9-b593-d223f7449a82 * HTML API: Remove nullable from get_breadcrumbs return type Follow-up [58713] Props jonsurrell, westonruter, gziolo. Fixes #62674. git-svn-id: https://develop.svn.wordpress.org/trunk@59503 602fd350-edb4-49c9-b593-d223f7449a82 * Twenty Twenty-Two: Fix PHPCS issues in `functions.php`. * Inline comments must end in full stops, exclamation marks, or question marks. * There must be exactly one blank line after the file comment. Follow-up to [52081]. Props pitamdey, mukesh27. Fixes #62648. git-svn-id: https://develop.svn.wordpress.org/trunk@59504 602fd350-edb4-49c9-b593-d223f7449a82 * Docs: Correct formatting for script module data filter documentation examples. Follow-up to [58579]. Props jonsurrell. See #62281. git-svn-id: https://develop.svn.wordpress.org/trunk@59505 602fd350-edb4-49c9-b593-d223f7449a82 * Filesystem API: Check `PHP_OS_FAMILY` instead of `php_uname()` in PclZip. The `php_uname()` function can be disabled on some hosts, in which case the call fails. The `PHP_OS_FAMILY` constant indicates the operating system family PHP was built for, and is available as of PHP 7.2.0. Reference: [https://www.php.net/manual/en/reserved.constants.php#constant.php-os-family PHP Manual: Predefined Constants: PHP_OS_FAMILY]. Follow-up to [6779], [57985], [58678], [58684]. Props daymobrew, costdev, desrosj. Fixes #57711. git-svn-id: https://develop.svn.wordpress.org/trunk@59506 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Remove repository specific logic from callable workflows. Because reusable workflows could be called from any other repository in a variety of contexts, repository specific `if` conditions should not be present. Instead, this logic should be included in the calling workflows only. Props johnbillion. See #62221. git-svn-id: https://develop.svn.wordpress.org/trunk@59507 602fd350-edb4-49c9-b593-d223f7449a82 * Build/Test Tools: Trim down the upgrade testing matrix. The upgrade testing workflow is currently a…
What?
One fix could be reverting this commit c5921d7.
Adding this compatibility is causing the bug reported in https://core.trac.wordpress.org/ticket/62447
The bug reports that uploading a transparent PNG by using the upload button on a Safari browser is renaming the filename and removing the transparent background.
We can make it conditional for non Safari browsers only.
Testing Instructions
Image:
In Chrome or Firefox, create a group, set a background color, upload a block image and use the upload button to upload you're transparent PNG. Check on the frontend that the image uploaded is a transparent PNG.
Do the same in Safari. Check on the frontend that the image uploaded is a transparent PNG.
Screenshots or screencast