Skip to content

Commit 06f7c82

Browse files
committed
I18N: Add hardening for invalid meta lines in MO files.
Props swissspidy, pander. Fixes #61794. git-svn-id: https://develop.svn.wordpress.org/trunk@58922 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 84332c9 commit 06f7c82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/l10n/class-wp-translation-file-mo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected function parse_file(): bool {
154154
// Metadata about the MO file is stored in the first translation entry.
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
}
160160

0 commit comments

Comments
 (0)