Actualizacion 7.1.2

This commit is contained in:
2026-09-25 12:02:42 -06:00
parent fa60d1f364
commit 32351c9497
221 changed files with 19735 additions and 6951 deletions
+22 -2
View File
@@ -2059,6 +2059,13 @@ function wp_ajax_menu_quick_search() {
function wp_ajax_get_permalink() {
check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
$post_id = isset( $_POST['post_id'] ) ? (int) $_POST['post_id'] : 0;
if ( ! $post_id ) {
// Bypass call to get_preview_post_link() for unspecified post ID.
wp_die( '' );
}
if ( ! current_user_can( 'edit_post', $post_id ) ) {
wp_die( -1 );
}
wp_die( get_preview_post_link( $post_id ) );
}
@@ -2070,8 +2077,15 @@ function wp_ajax_get_permalink() {
function wp_ajax_sample_permalink() {
check_ajax_referer( 'samplepermalink', 'samplepermalinknonce' );
$post_id = isset( $_POST['post_id'] ) ? (int) $_POST['post_id'] : 0;
$title = $_POST['new_title'] ?? '';
$slug = $_POST['new_slug'] ?? null;
if ( ! $post_id ) {
// Bypass call to get_sample_permalink_html() for unspecified post ID.
wp_die( '' );
}
if ( ! current_user_can( 'edit_post', $post_id ) ) {
wp_die( -1 );
}
$title = $_POST['new_title'] ?? '';
$slug = $_POST['new_slug'] ?? null;
wp_die( get_sample_permalink_html( $post_id, $title, $slug ) );
}
@@ -4615,6 +4629,12 @@ function wp_ajax_activate_plugin() {
wp_send_json_error( $status );
}
// A network-only plugin is activated for the entire network.
if ( is_multisite() && is_network_only_plugin( $status['plugin'] ) && ! current_user_can( 'manage_network_plugins' ) ) {
$status['errorMessage'] = __( 'Sorry, you are not allowed to activate this plugin.' );
wp_send_json_error( $status );
}
if ( is_plugin_active( $status['plugin'] ) ) {
$status['errorMessage'] = sprintf(
/* translators: %s: Plugin name. */
@@ -572,7 +572,7 @@ class Custom_Image_Header {
$header_image_style .= 'height:' . $custom_header->height . 'px;';
}
?>
<div id="headimg" style="<?php echo $header_image_style; ?>">
<div id="headimg" style="<?php echo esc_attr( $header_image_style ); ?>">
<?php
if ( display_header_text() ) {
$style = ' style="color:#' . get_header_textcolor() . ';"';
@@ -1184,8 +1184,8 @@ endif;
'attachment_id' => $choice['attachment_id'],
'url' => $choice['url'],
'thumbnail_url' => $choice['url'],
'height' => $choice['height'],
'width' => $choice['width'],
'height' => absint( $choice['height'] ),
'width' => absint( $choice['width'] ),
);
update_post_meta( $choice['attachment_id'], '_wp_attachment_is_custom_header', get_stylesheet() );
@@ -1216,7 +1216,13 @@ endif;
}
}
set_theme_mod( 'header_image', sanitize_url( $header_image_data['url'] ) );
$header_image_data['url'] = sanitize_url( $header_image_data['url'] );
if ( isset( $header_image_data['thumbnail_url'] ) ) {
$header_image_data['thumbnail_url'] = sanitize_url( $header_image_data['thumbnail_url'] );
}
set_theme_mod( 'header_image', $header_image_data['url'] );
set_theme_mod( 'header_image_data', $header_image_data );
}
@@ -1589,9 +1595,8 @@ endif;
$alt_text_key = '_wp_attachment_image_alt';
foreach ( $header_images as &$header_image ) {
$header_meta = get_post_meta( $header_image['attachment_id'] );
$header_image['timestamp'] = $header_meta[ $timestamp_key ] ?? '';
$header_image['alt_text'] = $header_meta[ $alt_text_key ] ?? '';
$header_image['timestamp'] = get_post_meta( $header_image['attachment_id'], $timestamp_key, true );
$header_image['alt_text'] = get_post_meta( $header_image['attachment_id'], $alt_text_key, true );
}
return $header_images;
+1 -1
View File
@@ -3370,7 +3370,7 @@ function attachment_submitbox_metadata() {
<?php
if ( $post->post_parent ) {
$post_parent = get_post( $post->post_parent );
if ( $post_parent ) {
if ( $post_parent && current_user_can( 'read_post', $post_parent->ID ) ) {
$uploaded_to_title = $post_parent->post_title ? $post_parent->post_title : __( '(no title)' );
$uploaded_to_link = get_edit_post_link( $post->post_parent, 'raw' );
?>
+1
View File
@@ -1003,6 +1003,7 @@ function confirm_delete_users( $users ) {
'include' => $blog_users,
'show' => 'display_name_with_login',
'id' => "reassign_user_{$details->userblog_id}_{$delete_user->ID}",
'blog_id' => $details->userblog_id,
)
);
?>
+7 -1
View File
@@ -598,11 +598,17 @@ function is_plugin_active_for_network( $plugin ) {
* Checks for "Site Wide Only: true" for backward compatibility.
*
* @since 3.0.0
* @since 7.1.1 The `$plugin` path is normalized with `plugin_basename()` and `trim()`,
* matching how `activate_plugin()` resolves it.
*
* @param string $plugin Path to the plugin file relative to the plugins directory.
* @param string $plugin Path to the plugin file. Accepts a path relative to the plugins
* directory, or an absolute path, with or without surrounding whitespace.
* @return bool True if plugin is network only, false otherwise.
*/
function is_network_only_plugin( $plugin ) {
// Normalize the path the same way activate_plugin() does, so both agree on the file.
$plugin = plugin_basename( trim( $plugin ) );
$plugin_data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin );
if ( $plugin_data ) {
return $plugin_data['Network'];
+14
View File
@@ -24,6 +24,20 @@ function _wp_translate_postdata( $update = false, $post_data = null ) {
$post_data = &$_POST;
}
/*
* A raw `ID` on the create path (no `post_ID`) is an attempt to overwrite an
* existing post while bypassing the per-post capability checks below, which only
* run on the update path. Reject it outright: legitimate post creation never
* carries an `ID`.
*/
if ( ! $update && ! empty( $post_data['ID'] ) ) {
if ( 'page' === $post_data['post_type'] ) {
return new WP_Error( 'edit_others_pages', __( 'Sorry, you are not allowed to edit pages as this user.' ) );
} else {
return new WP_Error( 'edit_others_posts', __( 'Sorry, you are not allowed to edit posts as this user.' ) );
}
}
if ( $update ) {
$post_data['ID'] = (int) $post_data['post_ID'];
}