From fa9a33d818470a5796f0ff8797f98b510ed8de18 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 09:57:30 +0200 Subject: Merging upstream version 6.5+dfsg1. Signed-off-by: Daniel Baumann --- wp-includes/load.php | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'wp-includes/load.php') diff --git a/wp-includes/load.php b/wp-includes/load.php index 520902c..b7bde14 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -598,6 +598,10 @@ function wp_debug_mode() { error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); } + /* + * The 'REST_REQUEST' check here is optimistic as the constant is most + * likely not set at this point even if it is in fact a REST request. + */ if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || defined( 'MS_FILES_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() || wp_is_json_request() @@ -871,6 +875,8 @@ function wp_start_object_cache() { 'site-options', 'site-queries', 'site-transient', + 'theme_files', + 'translation_files', 'rss', 'users', 'user-queries', @@ -1009,6 +1015,8 @@ function wp_get_active_and_valid_plugins() { * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_plugins + * * @param string[] $plugins Array of absolute plugin main file paths. * @return string[] Filtered array of plugins, without any paused plugins. */ @@ -1041,12 +1049,14 @@ function wp_skip_paused_plugins( array $plugins ) { * @since 5.1.0 * @access private * - * @global string $pagenow The filename of the current screen. + * @global string $pagenow The filename of the current screen. + * @global string $wp_stylesheet_path Path to current theme's stylesheet directory. + * @global string $wp_template_path Path to current theme's template directory. * * @return string[] Array of absolute paths to theme directories. */ function wp_get_active_and_valid_themes() { - global $pagenow; + global $pagenow, $wp_stylesheet_path, $wp_template_path; $themes = array(); @@ -1054,14 +1064,11 @@ function wp_get_active_and_valid_themes() { return $themes; } - $stylesheet_path = get_stylesheet_directory(); - $template_path = get_template_directory(); - - if ( $template_path !== $stylesheet_path ) { - $themes[] = $stylesheet_path; + if ( is_child_theme() ) { + $themes[] = $wp_stylesheet_path; } - $themes[] = $template_path; + $themes[] = $wp_template_path; /* * Remove themes from the list of active themes when we're on an endpoint @@ -1084,6 +1091,8 @@ function wp_get_active_and_valid_themes() { * * @since 5.2.0 * + * @global WP_Paused_Extensions_Storage $_paused_themes + * * @param string[] $themes Array of absolute theme directory paths. * @return string[] Filtered array of absolute paths to themes, without any paused themes. */ @@ -1186,6 +1195,7 @@ function is_protected_ajax_action() { 'search-install-plugins', // Searching for a plugin in the plugin install screen. 'update-plugin', // Update an existing plugin. 'update-theme', // Update an existing theme. + 'activate-plugin', // Activating an existing plugin. ); /** @@ -1480,6 +1490,11 @@ function wp_load_translations_early() { // Translation and localization. require_once ABSPATH . WPINC . '/pomo/mo.php'; + require_once ABSPATH . WPINC . '/l10n/class-wp-translation-controller.php'; + require_once ABSPATH . WPINC . '/l10n/class-wp-translations.php'; + require_once ABSPATH . WPINC . '/l10n/class-wp-translation-file.php'; + require_once ABSPATH . WPINC . '/l10n/class-wp-translation-file-mo.php'; + require_once ABSPATH . WPINC . '/l10n/class-wp-translation-file-php.php'; require_once ABSPATH . WPINC . '/l10n.php'; require_once ABSPATH . WPINC . '/class-wp-textdomain-registry.php'; require_once ABSPATH . WPINC . '/class-wp-locale.php'; -- cgit v1.2.3