Make WordPress Core

Changeset 58922


Ignore:
Timestamp:
08/22/2024 08:06:05 AM (7 weeks ago)
Author:
swissspidy
Message:

I18N: Add hardening for invalid meta lines in MO files.

Props swissspidy, pander.
Fixes #61794.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/l10n/class-wp-translation-file-mo.php

    r57763 r58922  
    155155            if ( '' === $original ) {
    156156                foreach ( explode( "\n", $translation ) as $meta_line ) {
    157                     if ( '' === $meta_line ) {
     157                    if ( '' === $meta_line || ! str_contains( $meta_line, ':' ) ) {
    158158                        continue;
    159159                    }
Note: See TracChangeset for help on using the changeset viewer.