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
+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'];
}