Skip to content

Commit abb4e42

Browse files
Grouped backports to the 5.5 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.5 branch. Props tykoted, martinkrcho, xknown, dd32, peterwilsoncc, paulkevan, timothyblynjacobs. git-svn-id: https://develop.svn.wordpress.org/branches/5.5@53968 602fd350-edb4-49c9-b593-d223f7449a82
1 parent d24b3ea commit abb4e42

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

composer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
"phpunit/phpunit": "^5.7.21 || ^6.5 || ^7.5",
2020
"yoast/phpunit-polyfills": "^1.0.1"
2121
},
22+
"config": {
23+
"allow-plugins": {
24+
"dealerdirect/phpcodesniffer-composer-installer": true
25+
}
26+
},
2227
"scripts": {
2328
"compat": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --standard=phpcompat.xml.dist --report=summary,source",
2429
"format": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --report=summary,source",

src/wp-admin/plugins.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@
610610
/* translators: 1: Plugin file, 2: Error message. */
611611
__( 'The plugin %1$s has been deactivated due to an error: %2$s' ),
612612
'<code>' . esc_html( $plugin_file ) . '</code>',
613-
$error->get_error_message()
613+
esc_html( $error->get_error_message() )
614614
);
615615
echo '</p></div>';
616616
}
@@ -672,7 +672,7 @@
672672
printf(
673673
/* translators: %s: Error message. */
674674
__( 'Plugin could not be deleted due to an error: %s' ),
675-
$delete_result->get_error_message()
675+
esc_html( $delete_result->get_error_message() )
676676
);
677677
?>
678678
</p>

src/wp-includes/bookmark.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ function get_bookmarks( $args = '' ) {
307307
$query .= " $exclusions $inclusions $search";
308308
$query .= " ORDER BY $orderby $order";
309309
if ( -1 != $parsed_args['limit'] ) {
310-
$query .= ' LIMIT ' . $parsed_args['limit'];
310+
$query .= ' LIMIT ' . absint( $parsed_args['limit'] );
311311
}
312312

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

src/wp-includes/post-template.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,9 +1086,10 @@ function post_custom( $key = '' ) {
10861086
*
10871087
* @since 1.2.0
10881088
*
1089-
* @internal This will probably change at some point...
1089+
* @deprecated 6.0.2 Use get_post_meta() to retrieve post meta and render manually.
10901090
*/
10911091
function the_meta() {
1092+
_deprecated_function( __FUNCTION__, '6.0.2', 'get_post_meta()' );
10921093
$keys = get_post_custom_keys();
10931094
if ( $keys ) {
10941095
$li_html = '';
@@ -1104,8 +1105,8 @@ function the_meta() {
11041105
$html = sprintf(
11051106
"<li><span class='post-meta-key'>%s</span> %s</li>\n",
11061107
/* translators: %s: Post custom field name. */
1107-
sprintf( _x( '%s:', 'Post custom field name' ), $key ),
1108-
$value
1108+
esc_html( sprintf( _x( '%s:', 'Post custom field name' ), $key ) ),
1109+
esc_html( $value )
11091110
);
11101111

11111112
/**

0 commit comments

Comments
 (0)