Skip to content

Commit fc1f0ae

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

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/wp-admin/plugins.php

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

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

src/wp-includes/bookmark.php

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

287287
$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
@@ -975,10 +975,10 @@ function post_custom( $key = '' ) {
975975
*
976976
* @since 1.2.0
977977
*
978-
* @internal This will probably change at some point...
979-
*
978+
* @deprecated 6.0.2 Use get_post_meta() to retrieve post meta and render manually.
980979
*/
981980
function the_meta() {
981+
_deprecated_function( __FUNCTION__, '6.0.2', 'get_post_meta()' );
982982
if ( $keys = get_post_custom_keys() ) {
983983
echo "<ul class='post-meta'>\n";
984984
foreach ( (array) $keys as $key ) {
@@ -997,7 +997,7 @@ function the_meta() {
997997
* @param string $key Meta key.
998998
* @param string $value Meta value.
999999
*/
1000-
echo apply_filters( 'the_meta_key', "<li><span class='post-meta-key'>$key:</span> $value</li>\n", $key, $value );
1000+
echo apply_filters( 'the_meta_key', "<li><span class='post-meta-key'>" . esc_html( $key ) . ":</span>" . esc_html( $value ) . "</li>\n", $key, $value );
10011001
}
10021002
echo "</ul>\n";
10031003
}

0 commit comments

Comments
 (0)