Commit f328b9d451 for wordpress.org
commit f328b9d45126883dd909b532b90226d1342fe575
Author: jonsurrell <jonsurrell@git.wordpress.org>
Date: Thu Sep 10 11:19:59 2026 +0000
I18N: Validate cached translation file lists.
Prevent possible fatal errors on bad cached values by validating the caches is an array of strings.
Developed in: https://github.com/WordPress/wordpress-develop/pull/13429
Props josephscott, jonsurrell.
Fixes #66063.
Built from https://develop.svn.wordpress.org/trunk@63580
git-svn-id: http://core.svn.wordpress.org/trunk@62756 1a063a9b-81f0-0310-95a4-ce76da25c4cd
diff --git a/wp-includes/class-wp-textdomain-registry.php b/wp-includes/class-wp-textdomain-registry.php
index 7d924d5abd..8387d382ec 100644
--- a/wp-includes/class-wp-textdomain-registry.php
+++ b/wp-includes/class-wp-textdomain-registry.php
@@ -209,6 +209,14 @@ class WP_Textdomain_Registry {
$cache_key = md5( $path );
$files = wp_cache_get( $cache_key, 'translation_files' );
+ /*
+ * Verify that the cached value is an array and that all entries in that array
+ * are strings.
+ */
+ if ( ! is_array( $files ) || array_filter( $files, 'is_string' ) !== $files ) {
+ $files = false;
+ }
+
if ( false === $files ) {
$files = glob( $path . '*.mo' );
if ( false === $files ) {
diff --git a/wp-includes/version.php b/wp-includes/version.php
index 4987ff7a0e..3069da2e3b 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
-$wp_version = '7.2-alpha-63579';
+$wp_version = '7.2-alpha-63580';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.