From 2531f22a157e42b57ea1b52e3da5c1fcf99a2a22 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 22 Aug 2024 08:08:28 +0000 Subject: [PATCH] I18N: Add hardening for invalid meta lines in MO files. Props swissspidy, pander. Fixes #61794. Built from https://develop.svn.wordpress.org/trunk@58922 git-svn-id: http://core.svn.wordpress.org/trunk@58318 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/l10n/class-wp-translation-file-mo.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/l10n/class-wp-translation-file-mo.php b/wp-includes/l10n/class-wp-translation-file-mo.php index 3f5e72597c..f50c0ec1cf 100644 --- a/wp-includes/l10n/class-wp-translation-file-mo.php +++ b/wp-includes/l10n/class-wp-translation-file-mo.php @@ -154,7 +154,7 @@ class WP_Translation_File_MO extends WP_Translation_File { // Metadata about the MO file is stored in the first translation entry. if ( '' === $original ) { foreach ( explode( "\n", $translation ) as $meta_line ) { - if ( '' === $meta_line ) { + if ( '' === $meta_line || ! str_contains( $meta_line, ':' ) ) { continue; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 28f00871ae..d678e5d561 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58921'; +$wp_version = '6.7-alpha-58922'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.