From 809405e061e523a397b4858fd215bf00cd0a2916 Mon Sep 17 00:00:00 2001 From: Ella Date: Fri, 1 Nov 2024 11:27:20 +0100 Subject: [PATCH] check if post id is int --- lib/compat/wordpress-6.8/preload.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/compat/wordpress-6.8/preload.php b/lib/compat/wordpress-6.8/preload.php index 4a765c45adb4e..4151ec3c53366 100644 --- a/lib/compat/wordpress-6.8/preload.php +++ b/lib/compat/wordpress-6.8/preload.php @@ -11,7 +11,10 @@ function gutenberg_block_editor_preload_paths_6_8( $paths, $context ) { if ( 'core/edit-site' === $context->name ) { if ( ! empty( $_GET['postId'] ) ) { - $post = get_post( $_GET['postId'] ); + $post_id = (int) $_GET['postId']; + if ( $post_id ) { + $post = get_post( $post_id ); + } } if ( $post ) {