Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#62097 closed defect (bug) (duplicate)

MO-Translation: Undefinied Array-Key

Reported by: marcusthierfelder Owned by:
Priority: normal Milestone:
Component: I18N Version: 6.6.2
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

In the file wp-includes/l10n/class-wp-translation-file-mo.php in line 161, the following error occurs under certain circumstances:
“PHP message: PHP Warning: Undefined array key 1 in /wp-includes/l10n/class-wp-translation-file-mo.php on line 161”.

The error can be corrected by the following adjustment:

list( $name, $value ) = array_map( 'trim', array_pad(explode( ':', $meta_line, 2 ), 2, '' ));

Change History (2)

This ticket was mentioned in PR #7419 on WordPress/wordpress-develop by @narenin.


2 years ago
#1

  • Keywords has-patch added

#2 @swissspidy
2 years ago

  • Component GeneralI18N
  • Milestone Awaiting Review
  • Resolutionduplicate
  • Status newclosed

Hi there and welcome to Trac!

Thanks for the detailed report & patch.

If you encounter this issue, it means one of your plugins has a faulty MO file.

This issue was previously identified and fixed in #61794 and will be in WordPress 6.7.

Note: See TracTickets for help on using tickets.