Compare commits

...

22 Commits
5.3.2 ... 5.3.3

Author SHA1 Message Date
desrosj
055731393c Tag 5.3.3
Built from https://develop.svn.wordpress.org/tags/5.3.3@47708


git-svn-id: http://core.svn.wordpress.org/tags/5.3.3@47485 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-29 18:47:09 +00:00
Sergey Biryukov
d99c518d40 Update the About page for WordPress 5.3.3
Built from https://develop.svn.wordpress.org/branches/5.3@47705


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-29 18:43:02 +00:00
desrosj
9e08f12e0d Actually, WordPress 5.3.3 comes first.
Built from https://develop.svn.wordpress.org/branches/5.3@47684


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-29 18:06:02 +00:00
desrosj
644cb5fc24 WordPress 5.3.4
Built from https://develop.svn.wordpress.org/branches/5.3@47667


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47444 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-29 17:57:14 +00:00
whyisjake
bb6a2aa182 Customize: Add additional filters to Customizer to prevent JSON corruption.
User: Invalidate `user_activation_key` on password update.
Query: Ensure that only a single post can be returned on date/time based queries.
Block Editor: Coding standards, properly escape class names.
Cache API: Ensure proper escaping around the stats method in the cache API.
Formatting: Expand `sanitize_file_name` to have better support for utf8 characters.

Brings the changes in [47633], [47634], [47635], [47636], [47637], and [47638] to the 5.4 branch.

Props: aduth, batmoo, ehti, ellatrix, jorgefilipecosta, nickdaugherty, noisysocks, pento, peterwilsoncc, sergeybiryukov, sstoqnov, talldanwp, westi, westonruter, whyisjake, whyisjake, xknown.

Built from https://develop.svn.wordpress.org/branches/5.3@47644


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47419 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-29 16:06:08 +00:00
whyisjake
676e70c5c7 Bundled Themes: Update copyright year in readme.txt. - Revert [47629]
Reverts [47629] as the tests will be updated, rather then the themes.

Props peterwilsoncc, whyisjake.
Fixes #48566.

Built from https://develop.svn.wordpress.org/branches/5.3@47630


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47405 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-28 03:07:03 +00:00
whyisjake
5dee0c5fa4 Bundled Themes: Update copyright year in readme.txt.
Add a unit test to ensure the year stays up to date.

Extends [46721] to 2020 and the 5.3 branch.

Fixes #48566.


Built from https://develop.svn.wordpress.org/branches/5.3@47629


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47404 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-04-28 02:19:06 +00:00
Sergey Biryukov
b3d7e737ab Media: Improve the appearance of image editor on small and medium screens.
This prevents the main area of Edit Media screen from being pushed down too far.

Props sabernhardt, afercia, fierevere, sathyapulse, mikeschroder, johnbillion.
Merges [47418] to the 5.3 branch.
Fixes #48780. See #47136.
Built from https://develop.svn.wordpress.org/branches/5.3@47419


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47206 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-03-03 17:25:02 +00:00
Sergey Biryukov
511f7cb751 Privacy: Fix the URLs and legacy redirects for the personal data export and erasure screens.
Props Jurgen Oldenburg, garrett-eclipse.
Merges [47412] to the 5.3 branch.
Fixes #49476.
Built from https://develop.svn.wordpress.org/branches/5.3@47417


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47204 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-03-03 17:09:04 +00:00
Sergey Biryukov
0d0a870240 Tests: Correct assertions in test_site_dates_are_gmt().
`assertSame()` doesn't have the `$delta` parameter, only `assertEquals()` does.

Follow-up to [47313].

Merges [47318] to the 5.3 branch.
See #40364.
Built from https://develop.svn.wordpress.org/branches/5.3@47319


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47117 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-19 05:14:03 +00:00
Sergey Biryukov
cd6ac02117 Tests: Use delta comparison in test_site_dates_are_gmt() to avoid race conditions.
Merges [47313] to the 5.3 branch.
See #40364.
Built from https://develop.svn.wordpress.org/branches/5.3@47314


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47114 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-19 02:56:04 +00:00
Sergey Biryukov
77512de0c2 Administration: Correct alignment of form controls inside custom meta boxes.
Props audrasjb, dontdream, valentinbora.
Merges [47289] to the 5.3 branch.
Fixes #49013.
Built from https://develop.svn.wordpress.org/branches/5.3@47290


git-svn-id: http://core.svn.wordpress.org/branches/5.3@47090 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-02-14 00:55:03 +00:00
Sergey Biryukov
4e55b9a259 Twenty Nineteen: Standardize the Required PHP and Tested Up To headers.
* Remove `WordPress` from `Requires at least` headers.
* Ensure the `Requires at least` and `Requires PHP` headers are present in the `style.css` file.

Follow-up to [46676], which updated `style-rtl.css`, but not `style.scss` or `style.css`.

Merges [47136] to the 5.3 branch.
See #48517.
Built from https://develop.svn.wordpress.org/branches/5.3@47137


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-30 20:08:04 +00:00
Sergey Biryukov
449c2e21f1 Media: Make sure attachment_url_to_postid() performs a case-sensitive search for the uploaded file name.
Previously, the first available match was returned, regardless of the case, which was not always the expected result.

Props archon810, ben.greeley, tristangemus, vsamoletov, SergeyBiryukov.
Merges [47010] to the 5.3 branch.
Fixes #39768.
Built from https://develop.svn.wordpress.org/branches/5.3@47132


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46932 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 16:36:03 +00:00
Sergey Biryukov
e6d839b936 Editor: Add unit tests for v5.3.1 block serialization functions.
[46896] was intended to have included unit tests for the block serialization functions added as part of the changeset.

Props aduth.
Merges [46997] to the 5.3 branch.
Fixes #49048.
Built from https://develop.svn.wordpress.org/branches/5.3@47131


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46931 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 16:21:05 +00:00
Sergey Biryukov
22b941b16e Upgrade/Install: Correct vertical alignment for "Continue" button on language selection during the install process.
Props garrett-eclipse, audrasjb.
Merges [47070] to the 5.3 branch.
Fixes #49018.
Built from https://develop.svn.wordpress.org/branches/5.3@47130


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46930 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 16:19:00 +00:00
Sergey Biryukov
3fc8c7687d Editor: Correct vertical alignment for "Published on" month dropdown in Classic Editor.
Props pratik-jain, justinahinon, audrasjb.
Merges [47072] to the 5.3 branch.
Fixes #49115.
Built from https://develop.svn.wordpress.org/branches/5.3@47129


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46929 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 16:17:02 +00:00
Sergey Biryukov
f5a8d325ee File Editor: Remove extra padding on submit button for "Select plugin/theme to edit" dropdown on smaller screens.
Props passoniate.
Merges [47071] to the 5.3 branch.
Fixes #49197.
Built from https://develop.svn.wordpress.org/branches/5.3@47128


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46928 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 16:14:04 +00:00
Sergey Biryukov
c7963618ca Date/Time: Use wp_date() to display the correct time of the next DST transition in Timezone setting on General Settings screen.
Props Rarst, autotutorial.
Merges [47073] to the 5.3 branch.
Fixes #49038.
Built from https://develop.svn.wordpress.org/branches/5.3@47127


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46927 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 16:12:04 +00:00
Sergey Biryukov
b1e2b6174d Media: After [46375], enable JavaScript translations for the media-views script.
Props ocean90, audrasjb.
Merges [47040] to the 5.3 branch.
Fixes #49134.
Built from https://develop.svn.wordpress.org/branches/5.3@47126


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46926 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 16:10:02 +00:00
Sergey Biryukov
dd4a67807a Build/Test Tools: Pass the TRAVIS_BRANCH and TRAVIS_PULL_REQUEST environment variables along to the Docker container.
This ensures that `WP_UnitTestCase::skipOnAutomatedBranches()` has access to these variables.

Correct the check for pull requests in `WP_UnitTestCase_Base::skipOnAutomatedBranches()`.

Merges [46999], [47000], and [47001] to the 5.3 branch.
Fixes #49050.
Built from https://develop.svn.wordpress.org/branches/5.3@47125


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46925 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-01-29 15:22:05 +00:00
Sergey Biryukov
5ae97a43f1 Post WordPress 5.3.2 version bump.
Built from https://develop.svn.wordpress.org/branches/5.3@46995


git-svn-id: http://core.svn.wordpress.org/branches/5.3@46795 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2019-12-18 22:49:03 +00:00
35 changed files with 245 additions and 87 deletions

View File

@@ -51,6 +51,26 @@ 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(

View File

@@ -3922,7 +3922,7 @@ img {
.fileedit-sub input[type="submit"] {
margin-bottom: 0px;
padding: 4px 18px;
padding: 0px 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: 4px 18px;
padding: 0px 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: 1.5; /* 18px */
line-height: 2.33333333; /* 28px */
}
#aa, #jj, #hh, #mn {
@@ -1387,6 +1387,40 @@ 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: 1.5; /* 18px */
line-height: 2.33333333; /* 28px */
}
#aa, #jj, #hh, #mn {
@@ -1387,6 +1387,40 @@ 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,6 +396,10 @@ 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,6 +396,10 @@ 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,10 +115,7 @@ 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,10 +115,7 @@ 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,6 +852,8 @@ 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 {
@@ -1207,6 +1209,7 @@ 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,6 +852,8 @@ 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 {
@@ -1207,6 +1209,7 @@ 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,34 +276,20 @@ if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
?>
<br />
<?php
$allowed_zones = timezone_identifiers_list();
if ( in_array( $tzstring, timezone_identifiers_list() ) ) {
$transitions = timezone_transitions_get( timezone_open( $tzstring ), time() );
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 ) {
// 0 index is the state at current time, 1 index is the next transition, if any.
if ( ! empty( $transitions[1] ) ) {
echo ' ';
$message = $tr['isdst'] ?
$message = $transitions[1]['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>' . date_i18n(
__( 'F j, Y' ) . ' ' . __( 'g:i a' ),
$tr['ts'] + ( $tz_offset - $tr['offset'] )
) . '</code>'
'<code>' . wp_date( __( 'F j, Y' ) . ' ' . __( 'g:i a' ), $transitions[1]['ts'] ) . '</code>'
);
} else {
_e( 'This timezone does not observe daylight saving time.' );

View File

@@ -18,24 +18,27 @@ 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,7 +2786,8 @@ 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,7 +5,8 @@ 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: WordPress 4.9.6
Requires at least: 4.9.6
Requires PHP: 5.2.4
Version: 1.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -2785,7 +2786,8 @@ 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,7 +4,8 @@ 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: WordPress 4.9.6
Requires at least: 4.9.6
Requires PHP: 5.2.4
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> $group - ( " . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
echo '<li><strong>Group:</strong> ' . esc_html( $group ) . ' - ( ' . number_format( strlen( serialize( $cache ) ) / KB_IN_BYTES, 2 ) . 'k )</li>';
}
echo '</ul>';
}

View File

@@ -2923,22 +2923,11 @@ 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().
* 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().
*/
// 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().
add_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5, 3 );
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.
@@ -2965,14 +2954,7 @@ final class WP_Customize_Manager {
$this->_changeset_post_id = $r; // Update cached post ID for the loaded changeset.
}
}
// Restore removed content filters.
if ( $has_kses ) {
kses_init_filters();
}
if ( $has_targeted_link_rel_filters ) {
wp_init_targeted_link_rel_filters();
}
remove_filter( 'wp_insert_post_data', array( $this, 'preserve_insert_changeset_post_content' ), 5 );
$this->_changeset_data = null; // Reset so WP_Customize_Manager::changeset_data() will re-populate with updated contents.
@@ -2990,6 +2972,51 @@ 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,10 +800,6 @@ 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

@@ -2003,6 +2003,24 @@ 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.
*
@@ -2012,7 +2030,6 @@ 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

@@ -4255,11 +4255,26 @@ function attachment_url_to_postid( $url ) {
}
$sql = $wpdb->prepare(
"SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file' AND meta_value = %s",
"SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = '_wp_attached_file' AND meta_value = %s",
$path
);
$post_id = $wpdb->get_var( $sql );
$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;
}
}
}
}
/**
* Filters an attachment id found by URL.

View File

@@ -3554,6 +3554,9 @@ 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(
@@ -3865,21 +3868,27 @@ 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 sanitized attachment post data.
* @param array $postarr An array of unsanitized attachment post data.
* @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().
*/
$data = apply_filters( 'wp_insert_attachment_data', $data, $postarr );
$data = apply_filters( 'wp_insert_attachment_data', $data, $postarr, $unsanitized_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 post data.
* @param array $postarr An array of sanitized, but otherwise unmodified post data.
* @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().
*/
$data = apply_filters( 'wp_insert_post_data', $data, $postarr );
$data = apply_filters( 'wp_insert_post_data', $data, $postarr, $unsanitized_postarr );
}
$data = wp_unslash( $data );
$where = array( 'ID' => $post_ID );

View File

@@ -1621,6 +1621,7 @@ 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 ) {
if ( $user_email !== $old_user_data->user_email || $user_pass !== $old_user_data->user_pass ) {
$data['user_activation_key'] = '';
}
$wpdb->update( $wpdb->users, $data, compact( 'ID' ) );
@@ -3063,7 +3063,11 @@ function _wp_privacy_send_request_confirmation_notification( $request_id ) {
return;
}
$manage_url = add_query_arg( 'page', $request->action_name, admin_url( 'tools.php' ) );
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' );
}
$action_description = wp_user_request_action_description( $request->action_name );
/**

View File

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