Changeset 55302
- Timestamp:
- 02/09/2023 04:33:36 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-textdomain-registry.php
r55010 r55302 1 1 <?php 2 2 /** 3 * Locale API: WP_Textdomain_Registry class 3 * Locale API: WP_Textdomain_Registry class. 4 * 5 * This file uses rtrim() instead of untrailingslashit() and trailingslashit() 6 * to avoid formatting.php dependency. 4 7 * 5 8 * @package WordPress … … 114 117 */ 115 118 public function set( $domain, $locale, $path ) { 116 $this->all[ $domain ][ $locale ] = $path ? trailingslashit( $path ): false;119 $this->all[ $domain ][ $locale ] = $path ? rtrim( $path, '/' ) . '/' : false; 117 120 $this->current[ $domain ] = $this->all[ $domain ][ $locale ]; 118 121 } … … 129 132 */ 130 133 public function set_custom_path( $domain, $path ) { 131 $this->custom_paths[ $domain ] = untrailingslashit( $path);134 $this->custom_paths[ $domain ] = rtrim( $path, '/' ); 132 135 } 133 136 … … 188 191 189 192 if ( $mo_path === $path ) { 190 $found_location = trailingslashit( $location );193 $found_location = rtrim( $location, '/' ) . '/'; 191 194 } 192 195 } … … 202 205 // using load_plugin_textdomain/load_theme_textdomain, use that one. 203 206 if ( 'en_US' !== $locale && isset( $this->custom_paths[ $domain ] ) ) { 204 $fallback_location = trailingslashit( $this->custom_paths[ $domain ] );207 $fallback_location = rtrim( $this->custom_paths[ $domain ], '/' ) . '/'; 205 208 $this->set( $domain, $locale, $fallback_location ); 206 209 return $fallback_location;
Note: See TracChangeset
for help on using the changeset viewer.