[wp-trac] [WordPress Trac] #48965: Prefer strict PHP comparisons over loose PHP comparisons
WordPress Trac
noreply at wordpress.org
Wed Apr 8 14:52:17 UTC 2020
#48965: Prefer strict PHP comparisons over loose PHP comparisons
-------------------------+-------------------------------
Reporter: pikamander2 | Owner: SergeyBiryukov
Type: enhancement | Status: closed
Priority: normal | Milestone: 5.4
Component: General | Version:
Severity: minor | Resolution: fixed
Keywords: | Focuses: coding-standards
-------------------------+-------------------------------
Comment (by MattyRob):
This is because `$post_title = xmlrpc_getposttitle( $content );` is
returning NULL instead of an empty string which is therefore failing the
strict comparison as newly implemented.
Perhaps in this instance it may be better to use:
`if ( empty( $post_title ) ) {`
Instead of:
`if ( '' === $post_title ) {`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/48965#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list