Changeset 45685 for trunk/src/wp-includes/l10n.php
- Timestamp:
- 07/27/2019 12:43:56 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r45590 r45685 949 949 $src_url = wp_parse_url( $src ); 950 950 $content_url = wp_parse_url( content_url() ); 951 $plugins_url = wp_parse_url( plugins_url() ); 951 952 $site_url = wp_parse_url( site_url() ); 952 953 953 954 // If the host is the same or it's a relative URL. 954 955 if ( 955 strpos( $src_url['path'], $content_url['path'] ) === 0&&956 ( ! isset( $content_url['path'] ) || strpos( $src_url['path'], $content_url['path'] ) === 0 ) && 956 957 ( ! isset( $src_url['host'] ) || $src_url['host'] === $content_url['host'] ) 957 958 ) { 958 959 // Make the src relative the specific plugin or theme. 959 $relative = trim( substr( $src_url['path'], strlen( $content_url['path'] ) ), '/' ); 960 if ( isset( $content_url['path'] ) ) { 961 $relative = substr( $src_url['path'], strlen( $content_url['path'] ) ); 962 } else { 963 $relative = $src_url['path']; 964 } 965 $relative = trim( $relative, '/' ); 960 966 $relative = explode( '/', $relative ); 961 967 962 968 $languages_path = WP_LANG_DIR . '/' . $relative[0]; 963 969 964 $relative = array_slice( $relative, 2 ); 970 $relative = array_slice( $relative, 2 ); // Remove plugins/<plugin name> or themes/<theme name>. 971 $relative = implode( '/', $relative ); 972 } elseif ( 973 ( ! isset( $plugins_url['path'] ) || strpos( $src_url['path'], $plugins_url['path'] ) === 0 ) && 974 ( ! isset( $src_url['host'] ) || $src_url['host'] === $plugins_url['host'] ) 975 ) { 976 // Make the src relative the specific plugin. 977 if ( isset( $plugins_url['path'] ) ) { 978 $relative = substr( $src_url['path'], strlen( $plugins_url['path'] ) ); 979 } else { 980 $relative = $src_url['path']; 981 } 982 $relative = trim( $relative, '/' ); 983 $relative = explode( '/', $relative ); 984 985 $languages_path = WP_LANG_DIR . '/plugins'; 986 987 $relative = array_slice( $relative, 1 ); // Remove <plugin name>. 965 988 $relative = implode( '/', $relative ); 966 989 } elseif ( ! isset( $src_url['host'] ) || $src_url['host'] === $site_url['host'] ) {
Note: See TracChangeset
for help on using the changeset viewer.