Ticket #54728: 54728.3.diff
File 54728.3.diff, 3.2 KB (added by , 3 years ago) |
---|
-
src/wp-admin/includes/image-edit.php
554 554 $filtered = array( $changes[0] ); 555 555 for ( $i = 0, $j = 1, $c = count( $changes ); $j < $c; $j++ ) { 556 556 $combined = false; 557 if ( $filtered[ $i ]->type == $changes[ $j ]->type ) {557 if ( $filtered[ $i ]->type === $changes[ $j ]->type ) { 558 558 switch ( $filtered[ $i ]->type ) { 559 559 case 'rotate': 560 560 $filtered[ $i ]->angle += $changes[ $j ]->angle; … … 603 603 foreach ( $changes as $operation ) { 604 604 switch ( $operation->type ) { 605 605 case 'rotate': 606 if ( 0 != $operation->angle ) {606 if ( 0 !== $operation->angle ) { 607 607 if ( $image instanceof WP_Image_Editor ) { 608 608 $image->rotate( $operation->angle ); 609 609 } else { … … 612 612 } 613 613 break; 614 614 case 'flip': 615 if ( 0 != $operation->axis ) {615 if ( 0 !== $operation->axis ) { 616 616 if ( $image instanceof WP_Image_Editor ) { 617 $image->flip( ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );617 $image->flip( ( $operation->axis & 1 ) !== 0, ( $operation->axis & 2 ) !== 0 ); 618 618 } else { 619 $image = _flip_image_resource( $image, ( $operation->axis & 1 ) != 0, ( $operation->axis & 2 ) != 0 );619 $image = _flip_image_resource( $image, ( $operation->axis & 1 ) !== 0, ( $operation->axis & 2 ) !== 0 ); 620 620 } 621 621 } 622 622 break; … … 711 711 if ( isset( $backup_sizes['full-orig'] ) && is_array( $backup_sizes['full-orig'] ) ) { 712 712 $data = $backup_sizes['full-orig']; 713 713 714 if ( $parts['basename'] != $data['file'] ) {714 if ( $parts['basename'] !== $data['file'] ) { 715 715 if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) { 716 716 717 717 // Delete only if it's an edited image. … … 738 738 foreach ( $default_sizes as $default_size ) { 739 739 if ( isset( $backup_sizes[ "$default_size-orig" ] ) ) { 740 740 $data = $backup_sizes[ "$default_size-orig" ]; 741 if ( isset( $meta['sizes'][ $default_size ] ) && $meta['sizes'][ $default_size ]['file'] != $data['file'] ) {741 if ( isset( $meta['sizes'][ $default_size ] ) && $meta['sizes'][ $default_size ]['file'] !== $data['file'] ) { 742 742 if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE ) { 743 743 744 744 // Delete only if it's an edited image. … … 853 853 $suffix = time() . rand( 100, 999 ); 854 854 855 855 if ( defined( 'IMAGE_EDIT_OVERWRITE' ) && IMAGE_EDIT_OVERWRITE && 856 isset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] != $basename ) {856 isset( $backup_sizes['full-orig'] ) && $backup_sizes['full-orig']['file'] !== $basename ) { 857 857 858 858 if ( 'thumbnail' === $target ) { 859 859 $new_path = "{$dirname}/{$filename}-temp.{$ext}"; … … 943 943 $tag = false; 944 944 if ( isset( $meta['sizes'][ $size ] ) ) { 945 945 if ( isset( $backup_sizes[ "$size-orig" ] ) ) { 946 if ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes[ "$size-orig" ]['file'] != $meta['sizes'][ $size ]['file'] ) {946 if ( ( ! defined( 'IMAGE_EDIT_OVERWRITE' ) || ! IMAGE_EDIT_OVERWRITE ) && $backup_sizes[ "$size-orig" ]['file'] !== $meta['sizes'][ $size ]['file'] ) { 947 947 $tag = "$size-$suffix"; 948 948 } 949 949 } else {