Don't loosely compare functions that return `bool` against a literal `bool`.

See #32444.


git-svn-id: https://develop.svn.wordpress.org/trunk@32730 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2015-06-12 17:18:38 +00:00
parent 40c54bc238
commit 3f29a2101d
5 changed files with 7 additions and 7 deletions

View File

@ -133,9 +133,9 @@ function export_wp( $args = array() ) {
* @return string
*/
function wxr_cdata( $str ) {
if ( seems_utf8( $str ) == false )
if ( ! seems_utf8( $str ) ) {
$str = utf8_encode( $str );
}
// $str = ent2ncr(esc_html($str));
$str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';

View File

@ -182,7 +182,7 @@ unset($id, $data, $subs, $first_sub);
$separator_found = false;
foreach ( $menu as $id => $data ) {
if ( 0 == strcmp('wp-menu-separator', $data[4] ) ) {
if (false == $separator_found) {
if ( ! $separator_found ) {
$separator_found = true;
} else {
unset($menu[$id]);

View File

@ -453,9 +453,9 @@ function display_space_usage() {
* @return int Max size in bytes
*/
function fix_import_form_size( $size ) {
if ( upload_is_user_over_quota( false ) == true )
if ( upload_is_user_over_quota( false ) ) {
return 0;
}
$available = get_upload_space_available();
return min( $size, $available );
}

View File

@ -76,7 +76,7 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
if ( !$user_id ) { // Create a new user with a random password
$password = wp_generate_password( 12, false );
$user_id = wpmu_create_user( $domain, $password, $email );
if ( false == $user_id )
if ( false === $user_id )
wp_die( __( 'There was an error creating the user.' ) );
else
wp_new_user_notification( $user_id, $password );

View File

@ -70,7 +70,7 @@ if ( $action ) {
$password = wp_generate_password( 12, false);
$user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
if ( false == $user_id ) {
if ( false === $user_id ) {
$update = 'err_new_dup';
} else {
wp_new_user_notification( $user_id, $password );