Make WordPress Core


Ignore:
Timestamp:
01/16/2024 09:43:11 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-textdomain-registry.php

    r57290 r57299  
    238238            switch ( $type ) {
    239239                case 'plugin':
    240                     wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins' ), 'translations' );
     240                    wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/plugins/' ), 'translations' );
    241241                    break;
    242242                case 'theme':
    243                     wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes' ), 'translations' );
     243                    wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/themes/' ), 'translations' );
    244244                    break;
    245245                default:
    246                     wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR ), 'translations' );
     246                    wp_cache_delete( 'cached_mo_files_' . md5( WP_LANG_DIR . '/' ), 'translations' );
    247247                    break;
    248248            }
Note: See TracChangeset for help on using the changeset viewer.