Compare commits

..

1 Commits
5.3.3 ... 5.3.1

Author SHA1 Message Date
Sergey Biryukov
378daf0472 Tag 5.3.1
Built from https://develop.svn.wordpress.org/tags/5.3.1@46937


git-svn-id: http://core.svn.wordpress.org/tags/5.3.1@46737 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-12 20:49:09 +00:00
66 changed files with 192 additions and 457 deletions

View File

@@ -51,51 +51,6 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<div class="about__section changelog">
<div class="column">
<h2><?php _e( 'Maintenance and Security Releases' ); ?></h2>
<p>
<?php
printf(
/* translators: %s: WordPress version number */
__( '<strong>Version %s</strong> addressed some security issues.' ),
'5.3.3'
);
?>
<?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.3' )
)
);
?>
</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 %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(

View File

@@ -104,13 +104,9 @@ textarea:focus {
.button.active,
.button.active:focus,
.button.active:hover {
border-color: $button-color;
color: darken( #32373c, 5% );
box-shadow: inset 0 2px 5px -3px $button-color;
}
.button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: darken( $button-color, 5% );
color: darken( $button-text-color, 5% );
box-shadow: inset 0 2px 5px -3px darken( $button-color, 5% );
}
.button-primary {

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #e1a948;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #e1a948;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #dd9f32;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #dd9f32;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #e1a948;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #e1a948;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #dd9f32;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #dd9f32;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #c7a589;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #c7a589;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #bf9878;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #bf9878;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #c7a589;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #c7a589;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #bf9878;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #bf9878;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #a3b745;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #a3b745;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #93a43e;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #93a43e;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #a3b745;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #a3b745;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #93a43e;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #93a43e;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #04a4cc;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #04a4cc;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #0490b3;
color: #262626;
box-shadow: inset 0 2px 5px -3px #0490b3;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #04a4cc;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #04a4cc;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #0490b3;
color: #262626;
box-shadow: inset 0 2px 5px -3px #0490b3;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #e14d43;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #e14d43;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #dd382d;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #dd382d;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #e14d43;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #e14d43;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #dd382d;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #dd382d;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #9ebaa0;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #9ebaa0;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #8faf91;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #8faf91;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #9ebaa0;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #9ebaa0;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #8faf91;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #8faf91;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #dd823b;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #dd823b;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #d97426;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #d97426;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -91,13 +91,9 @@ textarea:focus {
.wp-core-ui .button.active,
.wp-core-ui .button.active:focus,
.wp-core-ui .button.active:hover {
border-color: #dd823b;
color: #262a2e;
box-shadow: inset 0 2px 5px -3px #dd823b;
}
.wp-core-ui .button.active:focus {
box-shadow: 0 0 0 1px #32373c;
border-color: #d97426;
color: #f2f2f2;
box-shadow: inset 0 2px 5px -3px #d97426;
}
.wp-core-ui .button-primary {

File diff suppressed because one or more lines are too long

View File

@@ -3922,7 +3922,7 @@ img {
.fileedit-sub input[type="submit"] {
margin-bottom: 0px;
padding: 0px 18px;
padding: 4px 18px;
}
#documentation label[for="docs-list"] {

File diff suppressed because one or more lines are too long

View File

@@ -3922,7 +3922,7 @@ img {
.fileedit-sub input[type="submit"] {
margin-bottom: 0px;
padding: 0px 18px;
padding: 4px 18px;
}
#documentation label[for="docs-list"] {

File diff suppressed because one or more lines are too long

View File

@@ -421,7 +421,7 @@ form#tags-filter {
#timestampdiv select {
vertical-align: top;
font-size: 12px;
line-height: 2.33333333; /* 28px */
line-height: 1.5; /* 18px */
}
#aa, #jj, #hh, #mn {
@@ -1387,40 +1387,6 @@ table.links-table {
}
}
/* one column on the attachment editor screen */
@media only screen and (max-width: 1200px) {
.post-type-attachment #poststuff {
min-width: 0;
}
.post-type-attachment #wpbody-content #poststuff #post-body {
margin: 0;
}
.post-type-attachment #wpbody-content #post-body.columns-2 #postbox-container-1 {
margin-left: 0;
width: 100%;
}
.post-type-attachment #poststuff #postbox-container-1 .empty-container,
.post-type-attachment #poststuff #postbox-container-1 #side-sortables:empty {
border: 0 none;
height: 0;
min-height: 0;
}
.post-type-attachment #poststuff #post-body.columns-2 #side-sortables {
min-height: 0;
width: auto;
}
/* hide the radio buttons for column prefs */
.post-type-attachment .screen-layout,
.post-type-attachment .columns-prefs {
display: none;
}
}
/* one column on the post write/edit screen */
@media only screen and (max-width: 850px) {
#poststuff {

File diff suppressed because one or more lines are too long

View File

@@ -421,7 +421,7 @@ form#tags-filter {
#timestampdiv select {
vertical-align: top;
font-size: 12px;
line-height: 2.33333333; /* 28px */
line-height: 1.5; /* 18px */
}
#aa, #jj, #hh, #mn {
@@ -1387,40 +1387,6 @@ table.links-table {
}
}
/* one column on the attachment editor screen */
@media only screen and (max-width: 1200px) {
.post-type-attachment #poststuff {
min-width: 0;
}
.post-type-attachment #wpbody-content #poststuff #post-body {
margin: 0;
}
.post-type-attachment #wpbody-content #post-body.columns-2 #postbox-container-1 {
margin-right: 0;
width: 100%;
}
.post-type-attachment #poststuff #postbox-container-1 .empty-container,
.post-type-attachment #poststuff #postbox-container-1 #side-sortables:empty {
border: 0 none;
height: 0;
min-height: 0;
}
.post-type-attachment #poststuff #post-body.columns-2 #side-sortables {
min-height: 0;
width: auto;
}
/* hide the radio buttons for column prefs */
.post-type-attachment .screen-layout,
.post-type-attachment .columns-prefs {
display: none;
}
}
/* one column on the post write/edit screen */
@media only screen and (max-width: 850px) {
#poststuff {

File diff suppressed because one or more lines are too long

View File

@@ -396,10 +396,6 @@ input[type="radio"].disabled:checked:before {
max-width: 100%;
}
.meta-box-sortables input {
vertical-align: middle;
}
.misc-pub-post-status select {
margin-top: 0;
}

File diff suppressed because one or more lines are too long

View File

@@ -396,10 +396,6 @@ input[type="radio"].disabled:checked:before {
max-width: 100%;
}
.meta-box-sortables input {
vertical-align: middle;
}
.misc-pub-post-status select {
margin-top: 0;
}

File diff suppressed because one or more lines are too long

View File

@@ -115,7 +115,10 @@ label {
padding: 0;
}
.language-chooser.wp-core-ui .step .button.button-large {
height: 36px;
font-size: 14px;
line-height: 2.35714285;
vertical-align: middle;
}
textarea {
border: 1px solid #ddd;

File diff suppressed because one or more lines are too long

View File

@@ -115,7 +115,10 @@ label {
padding: 0;
}
.language-chooser.wp-core-ui .step .button.button-large {
height: 36px;
font-size: 14px;
line-height: 2.35714285;
vertical-align: middle;
}
textarea {
border: 1px solid #ddd;

File diff suppressed because one or more lines are too long

View File

@@ -852,8 +852,6 @@ border color while dragging a file over the uploader drop area */
.wp_attachment_holder .imgedit-wrap .imgedit-panel-content {
float: right;
padding: 3px 0 0 16px;
min-width: 400px;
max-width: calc( 100% - 266px );
}
.wp_attachment_holder .imgedit-wrap .imgedit-settings {
@@ -1209,7 +1207,6 @@ audio, video {
.wp_attachment_holder .imgedit-wrap .imgedit-settings {
float: none;
width: auto;
max-width: none;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -852,8 +852,6 @@ border color while dragging a file over the uploader drop area */
.wp_attachment_holder .imgedit-wrap .imgedit-panel-content {
float: left;
padding: 3px 16px 0 0;
min-width: 400px;
max-width: calc( 100% - 266px );
}
.wp_attachment_holder .imgedit-wrap .imgedit-settings {
@@ -1209,7 +1207,6 @@ audio, video {
.wp_attachment_holder .imgedit-wrap .imgedit-settings {
float: none;
width: auto;
max-width: none;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -276,20 +276,34 @@ if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
?>
<br />
<?php
if ( in_array( $tzstring, timezone_identifiers_list() ) ) {
$transitions = timezone_transitions_get( timezone_open( $tzstring ), time() );
$allowed_zones = timezone_identifiers_list();
// 0 index is the state at current time, 1 index is the next transition, if any.
if ( ! empty( $transitions[1] ) ) {
if ( in_array( $tzstring, $allowed_zones ) ) {
$found = false;
$date_time_zone_selected = new DateTimeZone( $tzstring );
$tz_offset = timezone_offset_get( $date_time_zone_selected, date_create() );
$right_now = time();
foreach ( timezone_transitions_get( $date_time_zone_selected ) as $tr ) {
if ( $tr['ts'] > $right_now ) {
$found = true;
break;
}
}
if ( $found ) {
echo ' ';
$message = $transitions[1]['isdst'] ?
$message = $tr['isdst'] ?
/* translators: %s: Date and time. */
__( 'Daylight saving time begins on: %s.' ) :
/* translators: %s: Date and time. */
__( 'Standard time begins on: %s.' );
// Add the difference between the current offset and the new offset to ts to get the correct transition time from date_i18n().
printf(
$message,
'<code>' . wp_date( __( 'F j, Y' ) . ' ' . __( 'g:i a' ), $transitions[1]['ts'] ) . '</code>'
'<code>' . date_i18n(
__( 'F j, Y' ) . ' ' . __( 'g:i a' ),
$tr['ts'] + ( $tz_offset - $tr['offset'] )
) . '</code>'
);
} else {
_e( 'This timezone does not observe daylight saving time.' );

View File

@@ -18,27 +18,24 @@ if ( isset( $_GET['page'] ) && ! empty( $_POST ) ) {
}
}
/** WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );
// The privacy policy guide used to be outputted from here. Since WP 5.3 it is in wp-admin/privacy-policy-guide.php.
if ( isset( $_GET['wp-privacy-policy-guide'] ) ) {
require_once dirname( __DIR__ ) . '/wp-load.php';
wp_redirect( admin_url( 'privacy-policy-guide.php' ), 301 );
exit;
} elseif ( isset( $_GET['page'] ) ) {
// These were also moved to files in WP 5.3.
if ( $_GET['page'] === 'export_personal_data' ) {
require_once dirname( __DIR__ ) . '/wp-load.php';
wp_redirect( admin_url( 'export-personal-data.php' ), 301 );
exit;
} elseif ( $_GET['page'] === 'remove_personal_data' ) {
require_once dirname( __DIR__ ) . '/wp-load.php';
wp_redirect( admin_url( 'erase-personal-data.php' ), 301 );
exit;
}
}
/** WordPress Administration Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );
$title = __( 'Tools' );
get_current_screen()->add_help_tab(

View File

@@ -2786,8 +2786,7 @@ body.page .main-navigation {
background: transparent;
color: inherit;
cursor: pointer;
transition: background 250ms ease-in-out,
transform 150ms ease;
transition: background 250ms ease-in-out, transform 150ms ease;
-webkit-appearance: none;
-moz-appearance: none;
}

View File

@@ -5,8 +5,7 @@ Theme URI: https://wordpress.org/themes/twentynineteen/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether youre running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes.
Requires at least: 4.9.6
Requires PHP: 5.2.4
Requires at least: WordPress 4.9.6
Version: 1.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -2786,8 +2785,7 @@ body.page .main-navigation {
background: transparent;
color: inherit;
cursor: pointer;
transition: background 250ms ease-in-out,
transform 150ms ease;
transition: background 250ms ease-in-out, transform 150ms ease;
-webkit-appearance: none;
-moz-appearance: none;
}

View File

@@ -4,8 +4,7 @@ Theme URI: https://wordpress.org/themes/twentynineteen/
Author: the WordPress team
Author URI: https://wordpress.org/
Description: Our 2019 default theme is designed to show off the power of the block editor. It features custom styles for all the default blocks, and is built so that what you see in the editor looks like what you'll see on your website. Twenty Nineteen is designed to be adaptable to a wide range of websites, whether youre running a photo blog, launching a new business, or supporting a non-profit. Featuring ample whitespace and modern sans-serif headlines paired with classic serif body text, it's built to be beautiful on all screen sizes.
Requires at least: 4.9.6
Requires PHP: 5.2.4
Requires at least: WordPress 4.9.6
Version: 1.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

View File

@@ -695,7 +695,7 @@ class WP_Object_Cache {
echo '</p>';
echo '<ul>';
foreach ( $this->cache as $group => $cache ) {
echo '<li><strong>Group:</strong> ' . esc_html( $group ) . ' - ( ' . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
echo "<li><strong>Group:</strong> $group - ( " . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
}
echo '</ul>';
}

View File

@@ -2923,11 +2923,22 @@ final class WP_Customize_Manager {
add_filter( 'wp_save_post_revision_post_has_changed', array( $this, '_filter_revision_post_has_changed' ), 5, 3 );
/*
* Update the changeset post. The publish_customize_changeset action will cause the settings in the
* changeset to be saved via WP_Customize_Setting::save(). Updating a post with publish status will
* trigger WP_Customize_Manager::publish_changeset_values().
* Update the changeset post. The publish_customize_changeset action
* will cause the settings in the changeset to be saved via
* WP_Customize_Setting::save().
*/
add_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5, 3 );
// Prevent content filters from corrupting JSON in post_content.
$has_kses = ( false !== has_filter( 'content_save_pre', 'wp_filter_post_kses' ) );
if ( $has_kses ) {
kses_remove_filters();
}
$has_targeted_link_rel_filters = ( false !== has_filter( 'content_save_pre', 'wp_targeted_link_rel' ) );
if ( $has_targeted_link_rel_filters ) {
wp_remove_targeted_link_rel_filters();
}
// Note that updating a post with publish status will trigger WP_Customize_Manager::publish_changeset_values().
if ( $changeset_post_id ) {
if ( $args['autosave'] && 'auto-draft' !== get_post_status( $changeset_post_id ) ) {
// See _wp_translate_postdata() for why this is required as it will use the edit_post meta capability.
@@ -2954,7 +2965,14 @@ final class WP_Customize_Manager {
$this->_changeset_post_id = $r; // Update cached post ID for the loaded changeset.
}
}
remove_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5 );
// Restore removed content filters.
if ( $has_kses ) {
kses_init_filters();
}
if ( $has_targeted_link_rel_filters ) {
wp_init_targeted_link_rel_filters();
}
$this->_changeset_data = null; // Reset so WP_Customize_Manager::changeset_data() will re-populate with updated contents.
@@ -2972,51 +2990,6 @@ final class WP_Customize_Manager {
return $response;
}
/**
* Preserve the initial JSON post_content passed to save into the post.
*
* This is needed to prevent KSES and other {@see 'content_save_pre'} filters
* from corrupting JSON data.
*
* Note that WP_Customize_Manager::validate_setting_values() have already
* run on the setting values being serialized as JSON into the post content
* so it is pre-sanitized.
*
* Also, the sanitization logic is re-run through the respective
* WP_Customize_Setting::sanitize() method when being read out of the
* changeset, via WP_Customize_Manager::post_value(), and this sanitized
* value will also be sent into WP_Customize_Setting::update() for
* persisting to the DB.
*
* Multiple users can collaborate on a single changeset, where one user may
* have the unfiltered_html capability but another may not. A user with
* unfiltered_html may add a script tag to some field which needs to be kept
* intact even when another user updates the changeset to modify another field
* when they do not have unfiltered_html.
*
* @since 5.4.1
*
* @param array $data An array of slashed and processed post data.
* @param array $postarr An array of sanitized (and slashed) but otherwise unmodified post data.
* @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as originally passed to wp_insert_post().
* @return array Filtered post data.
*/
public function preserve_insert_changeset_post_content( $data, $postarr, $unsanitized_postarr ) {
if (
isset( $data['post_type'] ) &&
isset( $unsanitized_postarr['post_content'] ) &&
'customize_changeset' === $data['post_type'] ||
(
'revision' === $data['post_type'] &&
! empty( $data['post_parent'] ) &&
'customize_changeset' === get_post_type( $data['post_parent'] )
)
) {
$data['post_content'] = $unsanitized_postarr['post_content'];
}
return $data;
}
/**
* Trash or delete a changeset post.
*

View File

@@ -800,6 +800,10 @@ class WP_Query {
$this->is_single = true;
} elseif ( $qv['p'] ) {
$this->is_single = true;
} elseif ( ( '' !== $qv['hour'] ) && ( '' !== $qv['minute'] ) && ( '' !== $qv['second'] ) && ( '' != $qv['year'] ) && ( '' != $qv['monthnum'] ) && ( '' != $qv['day'] ) ) {
// If year, month, day, hour, minute, and second are set, a single
// post is being queried.
$this->is_single = true;
} elseif ( '' != $qv['pagename'] || ! empty( $qv['page_id'] ) ) {
$this->is_page = true;
$this->is_single = false;

View File

@@ -649,59 +649,55 @@ function self_link() {
}
/**
* Get the UTC time of the most recently modified post from WP_Query.
* Get the timestamp of the most recently modified post from WP_Query.
*
* If viewing a comment feed, the time of the most recently modified
* If viewing a comment feed, the timestamp of the most recently modified
* comment will be returned.
*
* @global WP_Query $wp_query WordPress Query object.
*
* @since 5.2.0
*
* @param string $format Date format string to return the time in.
* @return string|false The time in requested format, or false on failure.
* @param string $format Format of the timestamp to return, passed to mysql2date.
*
* @return string The timestamp.
*/
function get_feed_build_date( $format ) {
global $wp_query;
$datetime = false;
$max_modified_time = false;
$utc = new DateTimeZone( 'UTC' );
if ( ! empty( $wp_query ) && $wp_query->have_posts() ) {
// Extract the post modified times from the posts.
$modified_times = wp_list_pluck( $wp_query->posts, 'post_modified_gmt' );
// If this is a comment feed, check those objects too.
if ( $wp_query->is_comment_feed() && $wp_query->comment_count ) {
// Extract the comment modified times from the comments.
$comment_times = wp_list_pluck( $wp_query->comments, 'comment_date_gmt' );
// Add the comment times to the post times for comparison.
$modified_times = array_merge( $modified_times, $comment_times );
}
// Determine the maximum modified time.
$datetime = date_create_immutable_from_format( 'Y-m-d H:i:s', max( $modified_times ), $utc );
if ( empty( $wp_query ) || ! $wp_query->have_posts() ) {
// Fallback to last time any post was modified or published.
return get_lastpostmodified( 'GMT' );
}
if ( false === $datetime ) {
// Fall back to last time any post was modified or published.
$datetime = date_create_immutable_from_format( 'Y-m-d H:i:s', get_lastpostmodified( 'GMT' ), $utc );
// Extract the post modified times from the posts.
$modified_times = wp_list_pluck( $wp_query->posts, 'post_modified_gmt' );
// If this is a comment feed, check those objects too.
if ( $wp_query->is_comment_feed() && $wp_query->comment_count ) {
// Extract the comment modified times from the comments.
$comment_times = wp_list_pluck( $wp_query->comments, 'comment_date_gmt' );
// Add the comment times to the post times for comparison.
$modified_times = array_merge( $modified_times, $comment_times );
}
if ( false !== $datetime ) {
$max_modified_time = $datetime->format( $format );
}
// Determine the maximum modified time.
$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.
*
* @since 5.2.0
*
* @param string|false $max_modified_time Date the last post or comment was modified in the query, in UTC.
* False on failure.
* @param string $format The date format requested in get_feed_build_date().
* @param string $max_modified_time Date the last post or comment was modified in the query.
* @param string $format The date format requested in get_feed_build_date.
*/
return apply_filters( 'get_feed_build_date', $max_modified_time, $format );
}

View File

@@ -2003,24 +2003,6 @@ function remove_accents( $string ) {
function sanitize_file_name( $filename ) {
$filename_raw = $filename;
$special_chars = array( '?', '[', ']', '/', '\\', '=', '<', '>', ':', ';', ',', "'", '"', '&', '$', '#', '*', '(', ')', '|', '~', '`', '!', '{', '}', '%', '+', chr( 0 ) );
// Check for support for utf8 in the installed PCRE library once and store the result in a static.
static $utf8_pcre = null;
if ( ! isset( $utf8_pcre ) ) {
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
$utf8_pcre = @preg_match( '/^./u', 'a' );
}
if ( ! seems_utf8( $filename ) ) {
$_ext = pathinfo( $filename, PATHINFO_EXTENSION );
$_name = pathinfo( $filename, PATHINFO_FILENAME );
$filename = sanitize_title_with_dashes( $_name ) . '.' . $_ext;
}
if ( $utf8_pcre ) {
$filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
}
/**
* Filters the list of characters to remove from a filename.
*
@@ -2030,6 +2012,7 @@ function sanitize_file_name( $filename ) {
* @param string $filename_raw Filename as it was passed into sanitize_file_name().
*/
$special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
$filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
$filename = str_replace( $special_chars, '', $filename );
$filename = str_replace( array( '%20', '+' ), '-', $filename );
$filename = preg_replace( '/[\r\n\t -]+/', '-', $filename );

View File

@@ -2410,7 +2410,6 @@ function _wp_upload_dir( $time = null ) {
function wp_unique_filename( $dir, $filename, $unique_filename_callback = null ) {
// Sanitize the file name before we begin processing.
$filename = sanitize_file_name( $filename );
$ext2 = null;
// Separate the filename into a name and extension.
$ext = pathinfo( $filename, PATHINFO_EXTENSION );
@@ -2473,32 +2472,17 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null )
// Prevent collisions with existing file names that contain dimension-like strings
// (whether they are subsizes or originals uploaded prior to #42437).
$upload_dir = wp_get_upload_dir();
// The (resized) image files would have name and extension, and will be in the uploads dir.
if ( $name && $ext && @is_dir( $dir ) && false !== strpos( $dir, $upload_dir['basedir'] ) ) {
// List of all files and directories contained in $dir.
$files = @scandir( $dir );
if ( @is_dir( $dir ) && $name && $ext ) {
// List of all files and directories contained in $dir (with the "dot" files removed).
$files = array_diff( scandir( $dir ), array( '.', '..' ) );
if ( ! empty( $files ) ) {
// Remove "dot" dirs.
$files = array_diff( $files, array( '.', '..' ) );
}
if ( ! empty( $files ) ) {
// The extension case may have changed above.
$new_ext = ! empty( $ext2 ) ? $ext2 : $ext;
// Ensure this never goes into infinite loop
// as it uses pathinfo() and regex in the check but string replacement for the changes.
$count = count( $files );
$i = 0;
while ( $i <= $count && _wp_check_existing_file_names( $filename, $files ) ) {
while ( _wp_check_existing_file_names( $filename, $files ) ) {
$new_number = (int) $number + 1;
$filename = str_replace( array( "-{$number}{$new_ext}", "{$number}{$new_ext}" ), "-{$new_number}{$new_ext}", $filename );
$filename = str_replace( array( "-{$number}{$ext}", "{$number}{$ext}" ), "-{$new_number}{$ext}", $filename );
$number = $new_number;
$i++;
}
}
}
@@ -2540,7 +2524,7 @@ function _wp_check_existing_file_names( $filename, $files ) {
$ext = ".$ext";
}
$regex = '/^' . preg_quote( $fname ) . '-(?:\d+x\d+|scaled|rotated)' . preg_quote( $ext ) . '$/i';
$regex = '/^' . preg_quote( $fname ) . '-(?:\d+x\d+|scaled|rotated)' . preg_quote( $ext ) . '$/';
foreach ( $files as $file ) {
if ( preg_match( $regex, $file ) ) {

View File

@@ -4255,26 +4255,11 @@ function attachment_url_to_postid( $url ) {
}
$sql = $wpdb->prepare(
"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file' AND meta_value = %s",
"SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file' AND meta_value = %s",
$path
);
$results = $wpdb->get_results( $sql );
$post_id = null;
if ( $results ) {
// Use the first available result, but prefer a case-sensitive match, if exists.
$post_id = reset( $results )->post_id;
if ( count( $results ) > 1 ) {
foreach ( $results as $result ) {
if ( $path === $result->meta_value ) {
$post_id = $result->post_id;
break;
}
}
}
}
$post_id = $wpdb->get_var( $sql );
/**
* Filters an attachment id found by URL.

View File

@@ -3554,9 +3554,6 @@ function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) {
function wp_insert_post( $postarr, $wp_error = false ) {
global $wpdb;
// Capture original pre-sanitized array for passing into filters.
$unsanitized_postarr = $postarr;
$user_id = get_current_user_id();
$defaults = array(
@@ -3750,14 +3747,13 @@ function wp_insert_post( $postarr, $wp_error = false ) {
}
if ( 'attachment' !== $post_type ) {
$now = gmdate( 'Y-m-d H:i:s' );
if ( 'publish' === $post_status ) {
if ( strtotime( $post_date_gmt ) - strtotime( $now ) >= MINUTE_IN_SECONDS ) {
// String comparison to work around far future dates (year 2038+) on 32-bit systems.
if ( $post_date_gmt > gmdate( 'Y-m-d H:i:59' ) ) {
$post_status = 'future';
}
} elseif ( 'future' === $post_status ) {
if ( strtotime( $post_date_gmt ) - strtotime( $now ) < MINUTE_IN_SECONDS ) {
if ( $post_date_gmt <= gmdate( 'Y-m-d H:i:59' ) ) {
$post_status = 'publish';
}
}
@@ -3868,27 +3864,21 @@ function wp_insert_post( $postarr, $wp_error = false ) {
* Filters attachment post data before it is updated in or added to the database.
*
* @since 3.9.0
* @since 5.4.1 `$unsanitized_postarr` argument added.
*
* @param array $data An array of slashed, sanitized, and processed attachment post data.
* @param array $postarr An array of slashed and sanitized attachment post data, but not processed.
* @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed attachment post data
* as originally passed to wp_insert_post().
* @param array $data An array of sanitized attachment post data.
* @param array $postarr An array of unsanitized attachment post data.
*/
$data = apply_filters( 'wp_insert_attachment_data', $data, $postarr, $unsanitized_postarr );
$data = apply_filters( 'wp_insert_attachment_data', $data, $postarr );
} else {
/**
* Filters slashed post data just before it is inserted into the database.
*
* @since 2.7.0
* @since 5.4.1 `$unsanitized_postarr` argument added.
*
* @param array $data An array of slashed, sanitized, and processed post data.
* @param array $postarr An array of sanitized (and slashed) but otherwise unmodified post data.
* @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as
* originally passed to wp_insert_post().
* @param array $data An array of slashed post data.
* @param array $postarr An array of sanitized, but otherwise unmodified post data.
*/
$data = apply_filters( 'wp_insert_post_data', $data, $postarr, $unsanitized_postarr );
$data = apply_filters( 'wp_insert_post_data', $data, $postarr );
}
$data = wp_unslash( $data );
$where = array( 'ID' => $post_ID );
@@ -6395,7 +6385,7 @@ function get_posts_by_author_sql( $post_type, $full = true, $post_author = null,
* 'gmt' uses the `post_date_gmt` field.
* Default 'server'.
* @param string $post_type Optional. The post type to check. Default 'any'.
* @return string The date of the last post, or false on failure.
* @return string The date of the last post.
*/
function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) {
/**
@@ -6403,9 +6393,9 @@ function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) {
*
* @since 2.3.0
*
* @param string|false $date Date the last post was published. False on failure.
* @param string $timezone Location to use for getting the post published date.
* See get_lastpostdate() for accepted `$timezone` values.
* @param string $date Date the last post was published.
* @param string $timezone Location to use for getting the post published date.
* See get_lastpostdate() for accepted `$timezone` values.
*/
return apply_filters( 'get_lastpostdate', _get_last_post_time( $timezone, 'date', $post_type ), $timezone );
}
@@ -6424,7 +6414,7 @@ function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) {
* for information on accepted values.
* Default 'server'.
* @param string $post_type Optional. The post type to check. Default 'any'.
* @return string The timestamp in 'Y-m-d H:i:s' format, or false on failure.
* @return string The timestamp in 'Y-m-d H:i:s' format.
*/
function get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) {
/**
@@ -6455,10 +6445,9 @@ function get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) {
*
* @since 2.3.0
*
* @param string|false $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format.
* False on failure.
* @param string $timezone Location to use for getting the post modified date.
* See get_lastpostdate() for accepted `$timezone` values.
* @param string $lastpostmodified The most recent time that a post was modified, in 'Y-m-d H:i:s' format.
* @param string $timezone Location to use for getting the post modified date.
* See get_lastpostdate() for accepted `$timezone` values.
*/
return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone );
}
@@ -6476,7 +6465,7 @@ function get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) {
* for information on accepted values.
* @param string $field Post field to check. Accepts 'date' or 'modified'.
* @param string $post_type Optional. The post type to check. Default 'any'.
* @return string|false The timestamp in 'Y-m-d H:i:s' format, or false on failure.
* @return string|false The timestamp in 'Y-m-d H:i:s' format, or false on error.
*/
function _get_last_post_time( $timezone, $field, $post_type = 'any' ) {
global $wpdb;

View File

@@ -1621,7 +1621,6 @@ function wp_default_scripts( &$scripts ) {
// To enqueue media-views or media-editor, call wp_enqueue_media().
// Both rely on numerous settings, styles, and templates to operate correctly.
$scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement', 'wp-api-request', 'wp-a11y', 'wp-i18n' ), false, 1 );
$scripts->set_translations( 'media-views' );
$scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 );
$scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor' ), false, 1 );
$scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'jquery', 'media-views', 'media-audiovideo' ), false, 1 );

View File

@@ -1793,7 +1793,7 @@ function wp_insert_user( $userdata ) {
}
if ( $update ) {
if ( $user_email !== $old_user_data->user_email || $user_pass !== $old_user_data->user_pass ) {
if ( $user_email !== $old_user_data->user_email ) {
$data['user_activation_key'] = '';
}
$wpdb->update( $wpdb->users, $data, compact( 'ID' ) );
@@ -3063,11 +3063,7 @@ function _wp_privacy_send_request_confirmation_notification( $request_id ) {
return;
}
if ( 'export_personal_data' === $request->action_name ) {
$manage_url = admin_url( 'export-personal-data.php' );
} elseif ( 'remove_personal_data' === $request->action_name ) {
$manage_url = admin_url( 'erase-personal-data.php' );
}
$manage_url = add_query_arg( 'page', $request->action_name, admin_url( 'tools.php' ) );
$action_description = wp_user_request_action_description( $request->action_name );
/**

View File

@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3.3';
$wp_version = '5.3.1';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.