diff -r 7b1b88e27a20 -r 48c4eec2b7e6 wp/wp-admin/post.php --- a/wp/wp-admin/post.php Thu Sep 29 08:06:27 2022 +0200 +++ b/wp/wp-admin/post.php Fri Sep 05 18:40:08 2025 +0200 @@ -14,7 +14,7 @@ $parent_file = 'edit.php'; $submenu_file = 'edit.php'; -wp_reset_vars( array( 'action' ) ); +$action = ! empty( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : ''; if ( isset( $_GET['post'] ) && isset( $_POST['post_ID'] ) && (int) $_GET['post'] !== (int) $_POST['post_ID'] ) { wp_die( __( 'A post ID mismatch has been detected.' ), __( 'Sorry, you are not allowed to edit this item.' ), 400 ); @@ -28,9 +28,9 @@ $post_ID = $post_id; /** - * @global string $post_type - * @global object $post_type_object - * @global WP_Post $post Global post object. + * @global string $post_type Global post type. + * @global WP_Post_Type $post_type_object Global post type object. + * @global WP_Post $post Global post object. */ global $post_type, $post_type_object, $post; @@ -55,8 +55,8 @@ $sendback = wp_get_referer(); if ( ! $sendback || - false !== strpos( $sendback, 'post.php' ) || - false !== strpos( $sendback, 'post-new.php' ) ) { + str_contains( $sendback, 'post.php' ) || + str_contains( $sendback, 'post-new.php' ) ) { if ( 'attachment' === $post_type ) { $sendback = admin_url( 'upload.php' ); } else { @@ -97,7 +97,7 @@ $_POST['ping_status'] = get_default_comment_status( $post->post_type, 'pingback' ); // Wrap Quick Draft content in the Paragraph block. - if ( false === strpos( $_POST['content'], '' ) ) { + if ( ! str_contains( $_POST['content'], '' ) ) { $_POST['content'] = sprintf( '%s', str_replace( array( "\r\n", "\r", "\n" ), '
', $_POST['content'] )