Skip to content

Commit

Permalink
I18N: Prevent PHP warning in WP_Textdomain_Registry.
Browse files Browse the repository at this point in the history
Prevents a warning upon cache invalidation after language pack updates if the arguments don’t have the expected format.

Follow-up to [57287], [57290], [57298], [57299].

See #58919.

git-svn-id: https://develop.svn.wordpress.org/trunk@57303 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
swissspidy committed Jan 17, 2024
1 parent 935f4d1 commit c399654
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wp-includes/class-wp-textdomain-registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ public function get_language_files_from_path( $path ) {
* @return void
*/
public function invalidate_mo_files_cache( $upgrader, $hook_extra ) {
if ( 'translation' !== $hook_extra['type'] || array() === $hook_extra['translations'] ) {
if (
! isset( $hook_extra['type'] ) ||
'translation' !== $hook_extra['type'] ||
array() === $hook_extra['translations']
) {
return;
}

Expand Down

0 comments on commit c399654

Please sign in to comment.