WordPress.org

Make WordPress Core


Ignore:
Timestamp:
05/16/2020 06:40:52 PM (18 months ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Use strict comparison where static strings are involved.

This reduces the number of WordPress.PHP.StrictComparisons.LooseComparison issues in half, from 1897 to 890.

Includes minor code layout fixes for better readability.

See #49542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image-edit.php

    r47397 r47808  
    777777    $fheight = ! empty( $_REQUEST['fheight'] ) ? intval( $_REQUEST['fheight'] ) : 0;
    778778    $target  = ! empty( $_REQUEST['target'] ) ? preg_replace( '/[^a-z0-9_-]+/i', '', $_REQUEST['target'] ) : '';
    779     $scale   = ! empty( $_REQUEST['do'] ) && 'scale' == $_REQUEST['do'];
     779    $scale   = ! empty( $_REQUEST['do'] ) && 'scale' === $_REQUEST['do'];
    780780
    781781    if ( $scale && $fwidth > 0 && $fheight > 0 ) {
     
    831831        isset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] != $basename ) {
    832832
    833         if ( 'thumbnail' == $target ) {
     833        if ( 'thumbnail' === $target ) {
    834834            $new_path = "{$dirname}/{$filename}-temp.{$ext}";
    835835        } else {
     
    881881        $meta['height'] = $size['height'];
    882882
    883         if ( $success && ( 'nothumb' == $target || 'all' == $target ) ) {
     883        if ( $success && ( 'nothumb' === $target || 'all' === $target ) ) {
    884884            $sizes = get_intermediate_image_sizes();
    885             if ( 'nothumb' == $target ) {
     885            if ( 'nothumb' === $target ) {
    886886                $sizes = array_diff( $sizes, array( 'thumbnail' ) );
    887887            }
     
    890890        $return->fw = $meta['width'];
    891891        $return->fh = $meta['height'];
    892     } elseif ( 'thumbnail' == $target ) {
     892    } elseif ( 'thumbnail' === $target ) {
    893893        $sizes   = array( 'thumbnail' );
    894894        $success = true;
     
    959959        if ( 'thumbnail' === $target || 'all' === $target || 'full' === $target ) {
    960960            // Check if it's an image edit from attachment edit screen.
    961             if ( ! empty( $_REQUEST['context'] ) && 'edit-attachment' == $_REQUEST['context'] ) {
     961            if ( ! empty( $_REQUEST['context'] ) && 'edit-attachment' === $_REQUEST['context'] ) {
    962962                $thumb_url         = wp_get_attachment_image_src( $post_id, array( 900, 600 ), true );
    963963                $return->thumbnail = $thumb_url[0];
Note: See TracChangeset for help on using the changeset viewer.