Skip to content

Commit 08e560f

Browse files
Grouped backports to the 5.0 branch.
- Posts, Post Types: Escape output within `the_meta()`. - General: Ensure bookmark query limits are numeric. - Plugins: Escape output in error messages. - Build/Test Tools: Allow the PHPCS plugin in Composer configuration. Merges [52412,53958-53960] to the 5.0 branch. Props tykoted, martinkrcho, xknown, dd32, peterwilsoncc, paulkevan, timothyblynjacobs. git-svn-id: https://develop.svn.wordpress.org/branches/5.0@53973 602fd350-edb4-49c9-b593-d223f7449a82
1 parent dba2307 commit 08e560f

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
"dealerdirect/phpcodesniffer-composer-installer": "~0.4.4",
1414
"wp-coding-standards/wpcs": "~1.0.0"
1515
},
16+
"config": {
17+
"allow-plugins": {
18+
"dealerdirect/phpcodesniffer-composer-installer": true
19+
}
20+
},
1621
"scripts": {
1722
"format": "phpcbf --standard=phpcs.xml.dist --report-summary --report-source",
1823
"lint": "phpcs --standard=phpcs.xml.dist --report-summary --report-source"

src/wp-admin/plugins.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@
455455
/* translators: 1: plugin file 2: error message */
456456
__( 'The plugin %1$s has been <strong>deactivated</strong> due to an error: %2$s' ),
457457
'<code>' . esc_html( $plugin_file ) . '</code>',
458-
$error->get_error_message() );
458+
esc_html( $error->get_error_message() ) );
459459
echo '</p></div>';
460460
}
461461
}
@@ -490,7 +490,7 @@
490490
delete_transient( 'plugins_delete_result_' . $user_ID );
491491

492492
if ( is_wp_error($delete_result) ) : ?>
493-
<div id="message" class="error notice is-dismissible"><p><?php printf( __('Plugin could not be deleted due to an error: %s'), $delete_result->get_error_message() ); ?></p></div>
493+
<div id="message" class="error notice is-dismissible"><p><?php printf( __('Plugin could not be deleted due to an error: %s'), esc_html( $delete_result->get_error_message() ) ); ?></p></div>
494494
<?php else : ?>
495495
<div id="message" class="updated notice is-dismissible">
496496
<p>

src/wp-includes/bookmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ function get_bookmarks( $args = '' ) {
282282
$query .= " $exclusions $inclusions $search";
283283
$query .= " ORDER BY $orderby $order";
284284
if ( $r['limit'] != -1 ) {
285-
$query .= ' LIMIT ' . $r['limit'];
285+
$query .= ' LIMIT ' . absint( $r['limit'] );
286286
}
287287

288288
$results = $wpdb->get_results( $query );

src/wp-includes/post-template.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,10 +1003,10 @@ function post_custom( $key = '' ) {
10031003
*
10041004
* @since 1.2.0
10051005
*
1006-
* @internal This will probably change at some point...
1007-
*
1006+
* @deprecated 6.0.2 Use get_post_meta() to retrieve post meta and render manually.
10081007
*/
10091008
function the_meta() {
1009+
_deprecated_function( __FUNCTION__, '6.0.2', 'get_post_meta()' );
10101010
if ( $keys = get_post_custom_keys() ) {
10111011
echo "<ul class='post-meta'>\n";
10121012
foreach ( (array) $keys as $key ) {
@@ -1020,8 +1020,8 @@ function the_meta() {
10201020

10211021
$html = sprintf( "<li><span class='post-meta-key'>%s</span> %s</li>\n",
10221022
/* translators: %s: Post custom field name */
1023-
sprintf( _x( '%s:', 'Post custom field name' ), $key ),
1024-
$value
1023+
esc_html( sprintf( _x( '%s:', 'Post custom field name' ), $key ) ),
1024+
esc_html( $value )
10251025
);
10261026

10271027
/**

0 commit comments

Comments
 (0)