Skip to content

Commit c8e1c9b

Browse files
Grouped backports to the 4.5 branch.
- Posts, Post Types: Escape output within `the_meta()`. - General: Ensure bookmark query limits are numeric. - Plugins: Escape output in error messages. Merges [53958-53960] to the 4.5 branch. Props tykoted, martinkrcho, xknown, dd32, peterwilsoncc, paulkevan, timothyblynjacobs. git-svn-id: https://develop.svn.wordpress.org/branches/4.5@53978 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 7dfe7cc commit c8e1c9b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/wp-admin/plugins.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@
424424
/* translators: 1: plugin file 2: error message */
425425
__( 'The plugin %1$s has been <strong>deactivated</strong> due to an error: %2$s' ),
426426
'<code>' . esc_html( $plugin_file ) . '</code>',
427-
$error->get_error_message() );
427+
esc_html( $error->get_error_message() ) );
428428
echo '</p></div>';
429429
}
430430
}
@@ -459,7 +459,7 @@
459459
delete_transient( 'plugins_delete_result_' . $user_ID );
460460

461461
if ( is_wp_error($delete_result) ) : ?>
462-
<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>
462+
<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>
463463
<?php else : ?>
464464
<div id="message" class="updated notice is-dismissible">
465465
<p>

src/wp-includes/bookmark.php

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

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

src/wp-includes/post-template.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,10 +964,10 @@ function post_custom( $key = '' ) {
964964
*
965965
* @since 1.2.0
966966
*
967-
* @internal This will probably change at some point...
968-
*
967+
* @deprecated 6.0.2 Use get_post_meta() to retrieve post meta and render manually.
969968
*/
970969
function the_meta() {
970+
_deprecated_function( __FUNCTION__, '6.0.2', 'get_post_meta()' );
971971
if ( $keys = get_post_custom_keys() ) {
972972
echo "<ul class='post-meta'>\n";
973973
foreach ( (array) $keys as $key ) {
@@ -986,7 +986,7 @@ function the_meta() {
986986
* @param string $key Meta key.
987987
* @param string $value Meta value.
988988
*/
989-
echo apply_filters( 'the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value );
989+
echo apply_filters( 'the_meta_key', "<li><span class='post-meta-key'>" . esc_html( $key ) . ":</span>" . esc_html( $value ) . "</li>\n", $key, $value );
990990
}
991991
echo "</ul>\n";
992992
}

0 commit comments

Comments
 (0)