Update WordPress to latest.

parent 5916aacd
......@@ -130,7 +130,7 @@
color: #72777c;
}
.welcome-panel a {
.welcome-panel li a {
text-decoration: none;
}
......@@ -260,6 +260,16 @@
top: -2px;
}
.welcome-panel .welcome-widgets:before {
content: "\f538";
top: -2px;
}
.welcome-panel .welcome-menus:before {
content: "\f163";
top: -2px;
}
.welcome-panel .welcome-comments:before {
content: "\f117";
top: -1px;
......@@ -886,8 +896,9 @@ body #dashboard-widgets .postbox form .submit {
min-width: 0;
}
#dashboard-widgets a,
#dashboard-widgets .button-link {
#dashboard-widgets li a,
#dashboard-widgets .button-link,
.community-events-footer a {
text-decoration: none;
}
......
This diff is collapsed.
......@@ -130,7 +130,7 @@
color: #72777c;
}
.welcome-panel a {
.welcome-panel li a {
text-decoration: none;
}
......@@ -260,6 +260,16 @@
top: -2px;
}
.welcome-panel .welcome-widgets:before {
content: "\f538";
top: -2px;
}
.welcome-panel .welcome-menus:before {
content: "\f163";
top: -2px;
}
.welcome-panel .welcome-comments:before {
content: "\f117";
top: -1px;
......@@ -886,8 +896,9 @@ body #dashboard-widgets .postbox form .submit {
min-width: 0;
}
#dashboard-widgets a,
#dashboard-widgets .button-link {
#dashboard-widgets li a,
#dashboard-widgets .button-link,
.community-events-footer a {
text-decoration: none;
}
......
This diff is collapsed.
......@@ -1121,7 +1121,7 @@ p.popular-tags a {
margin: 5px 0 10px;
padding: 8px;
border: 1px solid #ddd;
line-height: 1.8;
line-height: 1.2;
word-spacing: 3px;
}
......
This diff is collapsed.
......@@ -1121,7 +1121,7 @@ p.popular-tags a {
margin: 5px 0 10px;
padding: 8px;
border: 1px solid #ddd;
line-height: 1.8;
line-height: 1.2;
word-spacing: 3px;
}
......
This diff is collapsed.
......@@ -631,12 +631,15 @@ class WP_List_Table {
<div class="view-switch">
<?php
foreach ( $this->modes as $mode => $title ) {
$classes = array( 'view-' . $mode );
$classes = array( 'view-' . $mode );
$aria_current = '';
if ( $current_mode === $mode ) {
$classes[] = 'current';
$classes[] = 'current';
$aria_current = ' aria-current="page"';
}
printf(
"<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
"<a href='%s' class='%s' id='view-switch-$mode'$aria_current><span class='screen-reader-text'>%s</span></a>\n",
esc_url( add_query_arg( 'mode', $mode ) ),
implode( ' ', $classes ),
$title
......
......@@ -1015,6 +1015,46 @@ class WP_Site_Health {
return $result;
}
/**
* Test if the PHP default timezone is set to UTC.
*
* @since 5.3.1
*
* @return array The test results.
*/
public function get_test_php_default_timezone() {
$result = array(
'label' => __( 'PHP default timezone is valid' ),
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
__( 'PHP default timezone was configured by WordPress on loading. This is necessary for correct calculations of dates and times.' )
),
'test' => 'php_default_timezone',
);
if ( 'UTC' !== date_default_timezone_get() ) {
$result['status'] = 'critical';
$result['label'] = __( 'PHP default timezone is invalid' );
$result['description'] = sprintf(
'<p>%s</p>',
sprintf(
/* translators: %s: date_default_timezone_set() */
__( 'PHP default timezone was changed after WordPress loading by a %s function call. This interferes with correct calculations of dates and times.' ),
'<code>date_default_timezone_set()</code>'
)
);
}
return $result;
}
/**
* Test if the SQL server is up to date.
*
......@@ -1842,51 +1882,55 @@ class WP_Site_Health {
public static function get_tests() {
$tests = array(
'direct' => array(
'wordpress_version' => array(
'wordpress_version' => array(
'label' => __( 'WordPress Version' ),
'test' => 'wordpress_version',
),
'plugin_version' => array(
'plugin_version' => array(
'label' => __( 'Plugin Versions' ),
'test' => 'plugin_version',
),
'theme_version' => array(
'theme_version' => array(
'label' => __( 'Theme Versions' ),
'test' => 'theme_version',
),
'php_version' => array(
'php_version' => array(
'label' => __( 'PHP Version' ),
'test' => 'php_version',
),
'sql_server' => array(
'label' => __( 'Database Server version' ),
'test' => 'sql_server',
),
'php_extensions' => array(
'php_extensions' => array(
'label' => __( 'PHP Extensions' ),
'test' => 'php_extensions',
),
'utf8mb4_support' => array(
'php_default_timezone' => array(
'label' => __( 'PHP Default Timezone' ),
'test' => 'php_default_timezone',
),
'sql_server' => array(
'label' => __( 'Database Server version' ),
'test' => 'sql_server',
),
'utf8mb4_support' => array(
'label' => __( 'MySQL utf8mb4 support' ),
'test' => 'utf8mb4_support',
),
'https_status' => array(
'https_status' => array(
'label' => __( 'HTTPS status' ),
'test' => 'https_status',
),
'ssl_support' => array(
'ssl_support' => array(
'label' => __( 'Secure communication' ),
'test' => 'ssl_support',
),
'scheduled_events' => array(
'scheduled_events' => array(
'label' => __( 'Scheduled events' ),
'test' => 'scheduled_events',
),
'http_requests' => array(
'http_requests' => array(
'label' => __( 'HTTP Requests' ),
'test' => 'http_requests',
),
'debug_enabled' => array(
'debug_enabled' => array(
'label' => __( 'Debugging enabled' ),
'test' => 'is_in_debug_mode',
),
......
......@@ -78,7 +78,7 @@ function _wp_credits_build_object_link( &$data ) {
}
/**
* Display a the title for a given group of contributors.
* Displays the title for a given group of contributors.
*
* @since 5.3.0
*
......@@ -106,7 +106,7 @@ function wp_credits_section_title( $group_data = array() ) {
}
/**
* Display a list of contributors for a given group.
* Displays a list of contributors for a given group.
*
* @since 5.3.0
*
......
......@@ -1797,22 +1797,11 @@ function wp_welcome_panel() {
<div class="welcome-panel-column welcome-panel-last">
<h3><?php _e( 'More Actions' ); ?></h3>
<ul>
<?php
if ( current_theme_supports( 'widgets' ) || current_theme_supports( 'menus' ) ) :
if ( current_theme_supports( 'widgets' ) && current_theme_supports( 'menus' ) ) {
$widgets_menus_link = sprintf(
/* translators: 1: URL to Widgets screen, 2: URL to Menus screen. */
__( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ),
admin_url( 'widgets.php' ),
admin_url( 'nav-menus.php' )
);
} elseif ( current_theme_supports( 'widgets' ) ) {
$widgets_menus_link = '<a href="' . admin_url( 'widgets.php' ) . '">' . __( 'Manage widgets' ) . '</a>';
} else {
$widgets_menus_link = '<a href="' . admin_url( 'nav-menus.php' ) . '">' . __( 'Manage menus' ) . '</a>';
}
?>
<li><div class="welcome-icon welcome-widgets-menus"><?php echo $widgets_menus_link; ?></div></li>
<?php if ( current_theme_supports( 'widgets' ) ) : ?>
<li><?php printf( '<a href="%s" class="welcome-icon welcome-widgets">' . __( 'Manage widgets' ) . '</a>', admin_url( 'widgets.php' ) ); ?></li>
<?php endif; ?>
<?php if ( current_theme_supports( 'menus' ) ) : ?>
<li><?php printf( '<a href="%s" class="welcome-icon welcome-menus">' . __( 'Manage menus' ) . '</a>', admin_url( 'nav-menus.php' ) ); ?></li>
<?php endif; ?>
<?php if ( current_user_can( 'manage_options' ) ) : ?>
<li><?php printf( '<a href="%s" class="welcome-icon welcome-comments">' . __( 'Turn comments on or off' ) . '</a>', admin_url( 'options-discussion.php' ) ); ?></li>
......
......@@ -417,10 +417,6 @@ wp.mediaWidgets = ( function( $ ) {
}).render();
this.content.set( view );
if ( ! wp.media.isTouchDevice ) {
view.url.focus();
}
}
});
......
This diff is collapsed.
......@@ -758,7 +758,7 @@ endif; //!IS_PROFILE_PAGE
}
if ( $value ) {
$output .= $value;
$output .= $cap;
} else {
/* translators: %s: Capability name. */
$output .= sprintf( __( 'Denied: %s' ), $cap );
......
......@@ -78,7 +78,6 @@ class WP_oEmbed {
'#https?://(.+\.)?imgur\.com/.*#i' => array( 'https://api.imgur.com/oembed', true ),
'#https?://(www\.)?meetu(\.ps|p\.com)/.*#i' => array( 'https://api.meetup.com/oembed', true ),
'#https?://(www\.)?issuu\.com/.+/docs/.+#i' => array( 'https://issuu.com/oembed_wp', true ),
'#https?://(www\.)?collegehumor\.com/video/.*#i' => array( 'https://www.collegehumor.com/oembed.{format}', true ),
'#https?://(www\.)?mixcloud\.com/.*#i' => array( 'https://www.mixcloud.com/oembed', true ),
'#https?://(www\.|embed\.)?ted\.com/talks/.*#i' => array( 'https://www.ted.com/services/v1/oembed.{format}', true ),
'#https?://(www\.)?(animoto|video214)\.com/play/.*#i' => array( 'https://animoto.com/oembeds/create', true ),
......@@ -164,7 +163,6 @@ class WP_oEmbed {
* | Meetup.com | meetu.ps | 3.9.0 |
* | Animoto | animoto.com | 4.0.0 |
* | Animoto | video214.com | 4.0.0 |
* | CollegeHumor | collegehumor.com | 4.0.0 |
* | Issuu | issuu.com | 4.0.0 |
* | Mixcloud | mixcloud.com | 4.0.0 |
* | Crowdsignal | poll.fm | 4.0.0 |
......@@ -211,6 +209,7 @@ class WP_oEmbed {
* | Vine | vine.co | 4.1.0 | 4.9.0 |
* | Photobucket | photobucket.com | 2.9.0 | 5.1.0 |
* | Funny or Die | funnyordie.com | 3.0.0 | 5.1.0 |
* | CollegeHumor | collegehumor.com | 4.0.0 | 5.3.1 |
*
* @see wp_oembed_add_provider()
*
......
......@@ -683,7 +683,13 @@ function get_feed_build_date( $format ) {
}
// Determine the maximum modified time.
$max_modified_time = mysql2date( $format, max( $modified_times ), false );
$datetime = date_create_immutable_from_format(
'Y-m-d H:i:s',
max( $modified_times ),
new DateTimeZone( 'UTC' )
);
$max_modified_time = $datetime->format( $format );
/**
* Filters the date the last post or comment in the query was modified.
......
......@@ -8758,8 +8758,12 @@ Settings = View.extend(/** @lends wp.media.view.Settings.prototype */{
// Handle button groups.
} else if ( $setting.hasClass('button-group') ) {
$buttons = $setting.find('button').removeClass('active');
$buttons.filter( '[value="' + value + '"]' ).addClass('active');
$buttons = $setting.find( 'button' )
.removeClass( 'active' )
.attr( 'aria-pressed', 'false' );
$buttons.filter( '[value="' + value + '"]' )
.addClass( 'active' )
.attr( 'aria-pressed', 'true' );
// Handle text inputs and textareas.
} else if ( $setting.is('input[type="text"], textarea') ) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2073,6 +2073,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
* @since 5.2.0 Added support for `background-position` and `grid-template-columns`
* @since 5.3.0 Added support for `grid`, `flex` and `column` layout properties.
* Extend `background-*` support of individual properties.
* @since 5.3.1 Added support for gradient backgrounds.
*
* @param string[] $attr Array of allowed CSS attributes.
*/
......@@ -2209,6 +2210,15 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
'list-style-image',
);
/*
* CSS attributes that accept gradient data types.
*
*/
$css_gradient_data_types = array(
'background',
'background-image',
);
if ( empty( $allowed_attr ) ) {
return $css;
}
......@@ -2223,6 +2233,7 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
$css_test_string = $css_item;
$found = false;
$url_attr = false;
$gradient_attr = false;
if ( strpos( $css_item, ':' ) === false ) {
$found = true;
......@@ -2231,8 +2242,9 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
$css_selector = trim( $parts[0] );
if ( in_array( $css_selector, $allowed_attr, true ) ) {
$found = true;
$url_attr = in_array( $css_selector, $css_url_data_types, true );
$found = true;
$url_attr = in_array( $css_selector, $css_url_data_types, true );
$gradient_attr = in_array( $css_selector, $css_gradient_data_types, true );
}
}
......@@ -2261,6 +2273,14 @@ function safecss_filter_attr( $css, $deprecated = '' ) {
}
}
if ( $found && $gradient_attr ) {
$css_value = trim( $parts[1] );
if ( preg_match( '/^(repeating-)?(linear|radial|conic)-gradient\(([^()]|rgb[a]?\([^()]*\))*\)$/', $css_value ) ) {
// Remove the whole `gradient` bit that was matched above from the CSS.
$css_test_string = str_replace( $css_value, '', $css_test_string );
}
}
// Remove any CSS containing containing \ ( & } = or comments, except for url() useage checked above.
if ( $found && ! preg_match( '%[\\\(&=}]|/\*%', $css_test_string ) ) {
if ( $css != '' ) {
......
......@@ -166,7 +166,6 @@ function get_permalink( $post = 0, $leavename = false ) {
$permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename );
if ( '' != $permalink && ! in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft', 'future' ) ) ) {
$unixtime = strtotime( $post->post_date );
$category = '';
if ( strpos( $permalink, '%category%' ) !== false ) {
......@@ -212,9 +211,11 @@ function get_permalink( $post = 0, $leavename = false ) {
$author = $authordata->user_nicename;
}
$date = explode( ' ', gmdate( 'Y m d H i s', $unixtime ) );
$rewritereplace =
array(
// This is not an API call because the permalink is based on the stored post_date value,
// which should be parsed as local time regardless of the default PHP timezone.
$date = explode( ' ', str_replace( array( '-', ':' ), ' ', $post->post_date ) );
$rewritereplace = array(
$date[0],
$date[1],
$date[2],
......@@ -227,8 +228,10 @@ function get_permalink( $post = 0, $leavename = false ) {
$author,
$post->post_name,
);
$permalink = home_url( str_replace( $rewritecode, $rewritereplace, $permalink ) );
$permalink = user_trailingslashit( $permalink, 'single' );
$permalink = home_url( str_replace( $rewritecode, $rewritereplace, $permalink ) );
$permalink = user_trailingslashit( $permalink, 'single' );
} else { // if they're not using the fancy permalink option
$permalink = home_url( '?p=' . $post->ID );
}
......
......@@ -318,7 +318,7 @@ function wp_print_media_templates() {
<a href="<?php echo esc_url( add_query_arg( 'mode', 'list', $_SERVER['REQUEST_URI'] ) ); ?>" class="view-list">
<span class="screen-reader-text"><?php _e( 'List View' ); ?></span>
</a>
<a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', $_SERVER['REQUEST_URI'] ) ); ?>" class="view-grid current">
<a href="<?php echo esc_url( add_query_arg( 'mode', 'grid', $_SERVER['REQUEST_URI'] ) ); ?>" class="view-grid current" aria-current="page">
<span class="screen-reader-text"><?php _e( 'Grid View' ); ?></span>
</a>
</script>
......
......@@ -214,7 +214,7 @@ function image_downsize( $id, $size = 'medium' ) {
// If the file isn't an image, attempt to replace its URL with a rendered image from its meta.
// Otherwise, a non-image type could be returned.
if ( ! $is_image ) {
if ( ! empty( $meta['sizes'] ) ) {
if ( ! empty( $meta['sizes']['full'] ) ) {
$img_url = str_replace( $img_url_basename, $meta['sizes']['full']['file'], $img_url );
$img_url_basename = $meta['sizes']['full']['file'];
$width = $meta['sizes']['full']['width'];
......
......@@ -189,16 +189,19 @@ function form_option( $option ) {
* Loads and caches all autoloaded options, if available or all options.
*
* @since 2.2.0
* @since 5.3.1 The `$force_cache` parameter was added.
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param bool $force_cache Optional. Whether to force an update of the local cache
* from the persistent cache. Default false.
* @return array List of all options.
*/
function wp_load_alloptions() {
function wp_load_alloptions( $force_cache = false ) {
global $wpdb;
if ( ! wp_installing() || ! is_multisite() ) {
$alloptions = wp_cache_get( 'alloptions', 'options' );
$alloptions = wp_cache_get( 'alloptions', 'options', $force_cache );
} else {
$alloptions = false;
}
......@@ -397,7 +400,7 @@ function update_option( $option, $value, $autoload = null ) {
}
if ( ! wp_installing() ) {
$alloptions = wp_load_alloptions();
$alloptions = wp_load_alloptions( true );
if ( isset( $alloptions[ $option ] ) ) {
$alloptions[ $option ] = $serialized_value;
wp_cache_set( 'alloptions', $alloptions, 'options' );
......@@ -505,7 +508,7 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' )
if ( ! wp_installing() ) {
if ( 'yes' == $autoload ) {
$alloptions = wp_load_alloptions();
$alloptions = wp_load_alloptions( true );
$alloptions[ $option ] = $serialized_value;
wp_cache_set( 'alloptions', $alloptions, 'options' );
} else {
......@@ -583,7 +586,7 @@ function delete_option( $option ) {
$result = $wpdb->delete( $wpdb->options, array( 'option_name' => $option ) );
if ( ! wp_installing() ) {
if ( 'yes' == $row->autoload ) {
$alloptions = wp_load_alloptions();
$alloptions = wp_load_alloptions( true );
if ( is_array( $alloptions ) && isset( $alloptions[ $option ] ) ) {
unset( $alloptions[ $option ] );
wp_cache_set( 'alloptions', $alloptions, 'options' );
......
......@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3.1-alpha-46728';
$wp_version = '5.3.1-alpha-46798';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
......
......@@ -1242,7 +1242,13 @@ switch ( $action ) {
$admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
if ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) {
$redirect_to = add_query_arg( 'action', 'confirm_admin_email', wp_login_url( $redirect_to ) );
$redirect_to = add_query_arg(
array(
'action' => 'confirm_admin_email',
'wp_lang' => get_user_locale( $user ),
),
wp_login_url( $redirect_to )
);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment