I18N: Correctly invalidate language file paths in WP_Textdomain_Registry.

Since the cache key in `::get_language_files_from_path()` is based on a path that always includes a trailing slash, the path in `::invalidate_mo_files_cache()` should include the trailing slash as well.

Includes adjusting the test expectations accordingly.

Follow-up to [57287], [57290], [57298].

See #58919.
Built from https://develop.svn.wordpress.org/trunk@57299


git-svn-id: http://core.svn.wordpress.org/trunk@56805 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-01-16 21:45:12 +00:00
parent fb3b7f59e3
commit 0a0b0e91cf
2 changed files with 4 additions and 4 deletions

View File

@ -237,13 +237,13 @@ class WP_Textdomain_Registry {
foreach ( $translation_types as $type ) { foreach ( $translation_types as $type ) {
switch ( $type ) { switch ( $type ) {
case 'plugin': case 'plugin':
wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins' ), 'translations' ); wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins/' ), 'translations' );
break; break;
case 'theme': case 'theme':
wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes' ), 'translations' ); wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes/' ), 'translations' );
break; break;
default: default:
wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR ), 'translations' ); wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/' ), 'translations' );
break; break;
} }
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.5-alpha-57298'; $wp_version = '6.5-alpha-57299';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.