Update WordPress to latest trunk.

parent 1479fa92
......@@ -14,4 +14,4 @@
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
require __DIR__ . '/wp-blog-header.php';
......@@ -9,9 +9,9 @@
define( 'WP_INSTALLING', true );
/** Sets up the WordPress Environment. */
require( dirname( __FILE__ ) . '/wp-load.php' );
require __DIR__ . '/wp-load.php';
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
require __DIR__ . '/wp-blog-header.php';
if ( ! is_multisite() ) {
wp_redirect( wp_registration_url() );
......@@ -37,7 +37,7 @@ if ( isset( $_GET['key'] ) && isset( $_POST['key'] ) && $_GET['key'] !== $_POST[
if ( $key ) {
$redirect_url = remove_query_arg( 'key' );
if ( $redirect_url !== remove_query_arg( false ) ) {
if ( remove_query_arg( false ) !== $redirect_url ) {
setcookie( $activate_cookie, $key, 0, $activate_path, COOKIE_DOMAIN, is_ssl(), true );
wp_safe_redirect( $redirect_url );
exit;
......@@ -46,13 +46,13 @@ if ( $key ) {
}
}
if ( $result === null && isset( $_COOKIE[ $activate_cookie ] ) ) {
if ( null === $result && isset( $_COOKIE[ $activate_cookie ] ) ) {
$key = $_COOKIE[ $activate_cookie ];
$result = wpmu_activate_signup( $key );
setcookie( $activate_cookie, ' ', time() - YEAR_IN_SECONDS, $activate_path, COOKIE_DOMAIN, is_ssl(), true );
}
if ( $result === null || ( is_wp_error( $result ) && 'invalid_key' === $result->get_error_code() ) ) {
if ( null === $result || ( is_wp_error( $result ) && 'invalid_key' === $result->get_error_code() ) ) {
status_header( 404 );
} elseif ( is_wp_error( $result ) ) {
$error_code = $result->get_error_code();
......@@ -68,7 +68,7 @@ if ( is_object( $wp_object_cache ) ) {
$wp_object_cache->cache_enabled = false;
}
// Fix for page title
// Fix for page title.
$wp_query->is_404 = false;
/**
......@@ -142,7 +142,7 @@ get_header( 'wp-activate' );
<h2><?php _e( 'Your account is now active!' ); ?></h2>
<?php
echo '<p class="lead-in">';
if ( $signup->domain . $signup->path == '' ) {
if ( '' === $signup->domain . $signup->path ) {
printf(
/* translators: 1: Login URL, 2: Username, 3: User email address, 4: Lost password URL. */
__( 'Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
......@@ -162,7 +162,7 @@ get_header( 'wp-activate' );
);
}
echo '</p>';
} elseif ( $result === null || is_wp_error( $result ) ) {
} elseif ( null === $result || is_wp_error( $result ) ) {
?>
<h2><?php _e( 'An error occurred during the activation' ); ?></h2>
<?php if ( is_wp_error( $result ) ) : ?>
......@@ -181,7 +181,7 @@ get_header( 'wp-activate' );
</div>
<?php
if ( $url && $url != network_home_url( '', 'http' ) ) :
if ( $url && network_home_url( '', 'http' ) !== $url ) :
switch_to_blog( (int) $result['blog_id'] );
$login_url = wp_login_url();
restore_current_blog();
......
......@@ -7,14 +7,14 @@
*/
/** WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );
require_once __DIR__ . '/admin.php';
/* translators: Page title of the About WordPress page in the admin. */
$title = _x( 'About', 'page title' );
list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
include( ABSPATH . 'wp-admin/admin-header.php' );
require_once ABSPATH . 'wp-admin/admin-header.php';
?>
<div class="wrap about__container">
......@@ -48,64 +48,6 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
</nav>
</div>
<div class="about__section changelog">
<div class="column">
<h2><?php _e( 'Maintenance and Security Releases' ); ?></h2>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
5
),
'5.3.2',
number_format_i18n( 5 )
);
?>
<?php
printf(
/* translators: %s: HelpHub URL */
__( 'For more information, see <a href="%s">the release notes</a>.' ),
sprintf(
/* translators: %s: WordPress version */
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
sanitize_title( '5.3.2' )
)
);
?>
</p>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: plural number of bugs. More than one security issue. */
_n(
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.',
46
),
'5.3.1',
number_format_i18n( 46 )
);
?>
<?php
printf(
/* translators: %s: HelpHub URL */
__( 'For more information, see <a href="%s">the release notes</a>.' ),
sprintf(
/* translators: %s: WordPress version */
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
sanitize_title( '5.3.1' )
)
);
?>
</p>
</div>
</div>
<hr />
<div class="about__section is-feature">
<p>
<?php _e( '5.3 expands and refines the block editor introduced in WordPress 5.0 with a new block, more intuitive interactions, and improved accessibility. New features in the editor increase design freedoms, provide additional layout options and style variations to allow designers complete control over the look of a site. This release also introduces the Twenty Twenty theme giving the user more design flexibility and integration with the block editor. Creating beautiful web pages and advanced layouts has never been easier.' ); ?>
......@@ -260,7 +202,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
</div>
<?php
include( ABSPATH . 'wp-admin/admin-footer.php' );
require_once ABSPATH . 'wp-admin/admin-footer.php';
// These are strings we may use to describe maintenance/security releases, where we aim for no new strings.
return;
......
......@@ -19,7 +19,7 @@ if ( ! defined( 'WP_ADMIN' ) ) {
}
/** Load WordPress Bootstrap */
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
require_once dirname( __DIR__ ) . '/wp-load.php';
/** Allow for cross-domain requests (from the front end). */
send_origin_headers();
......@@ -27,16 +27,16 @@ send_origin_headers();
header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
header( 'X-Robots-Tag: noindex' );
// Require an action parameter
// Require an action parameter.
if ( empty( $_REQUEST['action'] ) ) {
wp_die( '0', 400 );
}
/** Load WordPress Administration APIs */
require_once( ABSPATH . 'wp-admin/includes/admin.php' );
require_once ABSPATH . 'wp-admin/includes/admin.php';
/** Load Ajax Handlers for WordPress Core */
require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
require_once ABSPATH . 'wp-admin/includes/ajax-actions.php';
send_nosniff_header();
nocache_headers();
......@@ -141,7 +141,7 @@ $core_actions_post = array(
'health-check-get-sizes',
);
// Deprecated
// Deprecated.
$core_actions_post_deprecated = array( 'wp-fullscreen-save-post', 'press-this-save-post', 'press-this-add-category' );
$core_actions_post = array_merge( $core_actions_post, $core_actions_post_deprecated );
......@@ -189,5 +189,5 @@ if ( is_user_logged_in() ) {
*/
do_action( "wp_ajax_nopriv_{$action}" );
}
// Default status
// Default status.
wp_die( '0' );
......@@ -6,7 +6,7 @@
* @subpackage Administration
*/
// don't load directly
// Don't load directly.
if ( ! defined( 'ABSPATH' ) ) {
die( '-1' );
}
......@@ -104,7 +104,7 @@ do_action( 'admin_print_footer_scripts' );
*/
do_action( "admin_footer-{$hook_suffix}" ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
// get_site_option() won't exist when auto upgrading from <= 2.7
// get_site_option() won't exist when auto upgrading from <= 2.7.
if ( function_exists( 'get_site_option' ) ) {
if ( false === get_site_option( 'can_compress_scripts' ) ) {
compression_test();
......
......@@ -12,4 +12,4 @@
_deprecated_file( basename( __FILE__ ), '2.5.0', 'wp-admin/includes/admin.php' );
/** WordPress Administration API: Includes all Administration functions. */
require_once( ABSPATH . 'wp-admin/includes/admin.php' );
require_once ABSPATH . 'wp-admin/includes/admin.php';
......@@ -8,7 +8,7 @@
header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
if ( ! defined( 'WP_ADMIN' ) ) {
require_once( dirname( __FILE__ ) . '/admin.php' );
require_once __DIR__ . '/admin.php';
}
/**
......@@ -233,7 +233,7 @@ if ( current_user_can( 'customize' ) ) {
?>
<div id="wpwrap">
<?php require( ABSPATH . 'wp-admin/menu-header.php' ); ?>
<?php require ABSPATH . 'wp-admin/menu-header.php'; ?>
<div id="wpcontent">
<?php
......@@ -288,6 +288,6 @@ if ( is_network_admin() ) {
*/
do_action( 'all_admin_notices' );
if ( $parent_file == 'options-general.php' ) {
require( ABSPATH . 'wp-admin/options-head.php' );
if ( 'options-general.php' === $parent_file ) {
require ABSPATH . 'wp-admin/options-head.php';
}
......@@ -14,15 +14,15 @@ if ( ! defined( 'WP_ADMIN' ) ) {
}
if ( defined( 'ABSPATH' ) ) {
require_once( ABSPATH . 'wp-load.php' );
require_once ABSPATH . 'wp-load.php';
} else {
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
require_once dirname( __DIR__ ) . '/wp-load.php';
}