Coding Standards: Use strict comparison and Yoda conditions in the root directory files.

Props pikamander2.
Fixes #48965.
Built from https://develop.svn.wordpress.org/trunk@47054


git-svn-id: http://core.svn.wordpress.org/trunk@46854 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2020-01-09 00:55:05 +00:00
parent a24f5ccd1f
commit d784ebbcb4
7 changed files with 23 additions and 23 deletions

View File

@@ -101,7 +101,7 @@ for ( $i = 1; $i <= $count; $i++ ) {
$content_transfer_encoding = explode( ';', $content_transfer_encoding );
$content_transfer_encoding = $content_transfer_encoding[0];
}
if ( ( $content_type == 'multipart/alternative' ) && ( false !== strpos( $line, 'boundary="' ) ) && ( '' == $boundary ) ) {
if ( ( 'multipart/alternative' === $content_type ) && ( false !== strpos( $line, 'boundary="' ) ) && ( '' === $boundary ) ) {
$boundary = trim( $line );
$boundary = explode( '"', $boundary );
$boundary = $boundary[1];
@@ -142,11 +142,11 @@ for ( $i = 1; $i <= $count; $i++ ) {
}
if ( preg_match( '/Date: /i', $line ) ) { // of the form '20 Mar 2002 20:32:37 +0100'
$ddate = str_replace( 'Date: ', '', trim( $line ) );
$ddate = preg_replace( '!\s*\(.+\)\s*$!', '', $ddate ); // remove parenthesised timezone string if it exists, as this confuses strtotime
$ddate_U = strtotime( $ddate );
$post_date = gmdate( 'Y-m-d H:i:s', $ddate_U + $time_difference );
$post_date_gmt = gmdate( 'Y-m-d H:i:s', $ddate_U );
$ddate = str_replace( 'Date: ', '', trim( $line ) );
$ddate = preg_replace( '!\s*\(.+\)\s*$!', '', $ddate ); // remove parenthesised timezone string if it exists, as this confuses strtotime
$ddate_timestamp = strtotime( $ddate );
$post_date = gmdate( 'Y-m-d H:i:s', $ddate_timestamp + $time_difference );
$post_date_gmt = gmdate( 'Y-m-d H:i:s', $ddate_timestamp );
}
}
}
@@ -162,7 +162,7 @@ for ( $i = 1; $i <= $count; $i++ ) {
$subject = trim( $subject );
if ( $content_type == 'multipart/alternative' ) {
if ( 'multipart/alternative' === $content_type ) {
$content = explode( '--' . $boundary, $content );
$content = $content[2];
@@ -212,7 +212,7 @@ for ( $i = 1; $i <= $count; $i++ ) {
$post_title = xmlrpc_getposttitle( $content );
if ( $post_title == '' ) {
if ( '' === $post_title ) {
$post_title = $subject;
}