Make WordPress Core

Changeset 56017


Ignore:
Timestamp:
06/24/2023 01:52:11 PM (11 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use Yoda condition in str_ends_with().

This resolves a WPCS error:

Use Yoda Condition checks, you must.

Follow-up to [56015], [56016].

See #58220.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/compat.php

    r56016 r56017  
    489489        $len = strlen( $needle );
    490490
    491         return $needle === substr( $haystack, -$len, $len );
     491        return substr( $haystack, -$len, $len ) === $needle;
    492492    }
    493493}
Note: See TracChangeset for help on using the changeset viewer.