Make WordPress Core

Changeset 55654


Ignore:
Timestamp:
04/17/2023 04:59:57 PM (18 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where trim() is involved.

Follow-up to [17189], [24623], [55642], [55652], [55653].

Props aristath, poena, afercia, SergeyBiryukov.
See #57839.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-user-query.php

    r54766 r55654  
    690690
    691691        if ( $search ) {
    692             $leading_wild  = ( ltrim( $search, '*' ) != $search );
    693             $trailing_wild = ( rtrim( $search, '*' ) != $search );
     692            $leading_wild  = ( ltrim( $search, '*' ) !== $search );
     693            $trailing_wild = ( rtrim( $search, '*' ) !== $search );
    694694            if ( $leading_wild && $trailing_wild ) {
    695695                $wild = 'both';
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r55642 r55654  
    56635663                foreach ( $enclosures as $enc ) {
    56645664                    // This method used to omit the trailing new line. #23219
    5665                     if ( rtrim( $enc, "\n" ) == rtrim( $encstring, "\n" ) ) {
     5665                    if ( rtrim( $enc, "\n" ) === rtrim( $encstring, "\n" ) ) {
    56665666                        $found = true;
    56675667                        break;
Note: See TracChangeset for help on using the changeset viewer.