Changeset 55703 for trunk/src/wp-includes/l10n.php
- Timestamp:
- 05/02/2023 03:43:03 PM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r55351 r55703 1085 1085 $src = $wp_scripts->registered[ $handle ]->src; 1086 1086 1087 if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $wp_scripts->content_url && 0 === strpos( $src, $wp_scripts->content_url ) ) ) {1087 if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $wp_scripts->content_url && str_starts_with( $src, $wp_scripts->content_url ) ) ) { 1088 1088 $src = $wp_scripts->base_url . $src; 1089 1089 } … … 1099 1099 // If the host is the same or it's a relative URL. 1100 1100 if ( 1101 ( ! isset( $content_url['path'] ) || str pos( $src_url['path'], $content_url['path'] ) === 0) &&1101 ( ! isset( $content_url['path'] ) || str_starts_with( $src_url['path'], $content_url['path'] ) ) && 1102 1102 ( ! isset( $src_url['host'] ) || ! isset( $content_url['host'] ) || $src_url['host'] === $content_url['host'] ) 1103 1103 ) { … … 1116 1116 $relative = implode( '/', $relative ); 1117 1117 } elseif ( 1118 ( ! isset( $plugins_url['path'] ) || str pos( $src_url['path'], $plugins_url['path'] ) === 0) &&1118 ( ! isset( $plugins_url['path'] ) || str_starts_with( $src_url['path'], $plugins_url['path'] ) ) && 1119 1119 ( ! isset( $src_url['host'] ) || ! isset( $plugins_url['host'] ) || $src_url['host'] === $plugins_url['host'] ) 1120 1120 ) { … … 1135 1135 if ( ! isset( $site_url['path'] ) ) { 1136 1136 $relative = trim( $src_url['path'], '/' ); 1137 } elseif ( ( strpos( $src_url['path'], trailingslashit( $site_url['path'] ) ) === 0) ) {1137 } elseif ( str_starts_with( $src_url['path'], trailingslashit( $site_url['path'] ) ) ) { 1138 1138 // Make the src relative to the WP root. 1139 1139 $relative = substr( $src_url['path'], strlen( $site_url['path'] ) ); … … 1374 1374 foreach ( $lang_files as $lang_file ) { 1375 1375 $lang_file = basename( $lang_file, '.mo' ); 1376 if ( 0 !== strpos( $lang_file, 'continents-cities' ) && 0 !== strpos( $lang_file, 'ms-' ) &&1377 0 !== strpos( $lang_file, 'admin-' ) ) {1376 if ( ! str_starts_with( $lang_file, 'continents-cities' ) && ! str_starts_with( $lang_file, 'ms-' ) && 1377 ! str_starts_with( $lang_file, 'admin-' ) ) { 1378 1378 $languages[] = $lang_file; 1379 1379 }
Note: See TracChangeset
for help on using the changeset viewer.