Coding Standards: Use strict comparison in sanitize_post().

Follow-up to [12062].

Props aristath, poena, afercia, SergeyBiryukov.
See #62279.
Built from https://develop.svn.wordpress.org/trunk@59565


git-svn-id: http://core.svn.wordpress.org/trunk@58951 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-12-29 21:54:22 +00:00
parent 8166540e32
commit b8fa6385d0
2 changed files with 3 additions and 3 deletions

View File

@ -2823,7 +2823,7 @@ function is_sticky( $post_id = 0 ) {
function sanitize_post( $post, $context = 'display' ) { function sanitize_post( $post, $context = 'display' ) {
if ( is_object( $post ) ) { if ( is_object( $post ) ) {
// Check if post already filtered for this context. // Check if post already filtered for this context.
if ( isset( $post->filter ) && $context == $post->filter ) { if ( isset( $post->filter ) && $context === $post->filter ) {
return $post; return $post;
} }
if ( ! isset( $post->ID ) ) { if ( ! isset( $post->ID ) ) {
@ -2835,7 +2835,7 @@ function sanitize_post( $post, $context = 'display' ) {
$post->filter = $context; $post->filter = $context;
} elseif ( is_array( $post ) ) { } elseif ( is_array( $post ) ) {
// Check if post already filtered for this context. // Check if post already filtered for this context.
if ( isset( $post['filter'] ) && $context == $post['filter'] ) { if ( isset( $post['filter'] ) && $context === $post['filter'] ) {
return $post; return $post;
} }
if ( ! isset( $post['ID'] ) ) { if ( ! isset( $post['ID'] ) ) {

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.8-alpha-59564'; $wp_version = '6.8-alpha-59565';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.