Skip to content

Commit c399654

Browse files
committed
I18N: Prevent PHP warning in WP_Textdomain_Registry.
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
1 parent 935f4d1 commit c399654

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/wp-includes/class-wp-textdomain-registry.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,11 @@ public function get_language_files_from_path( $path ) {
228228
* @return void
229229
*/
230230
public function invalidate_mo_files_cache( $upgrader, $hook_extra ) {
231-
if ( 'translation' !== $hook_extra['type'] || array() === $hook_extra['translations'] ) {
231+
if (
232+
! isset( $hook_extra['type'] ) ||
233+
'translation' !== $hook_extra['type'] ||
234+
array() === $hook_extra['translations']
235+
) {
232236
return;
233237
}
234238

0 commit comments

Comments
 (0)