Make WordPress Core

Changeset 15003


Ignore:
Timestamp:
05/27/2010 08:41:36 PM (14 years ago)
Author:
markjaquith
Message:

Initialize instead of using isset(). props nacin. see #13556

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/media.php

    r15002 r15003  
    278278
    279279    $width_ratio = $height_ratio = 1.0;
     280    $did_width = $did_height = false;
    280281
    281282    if ( $max_width > 0 && $current_width > 0 && $current_width > $max_width ) {
     
    306307    // We also have issues with recursive calls resulting in an ever-changing result. Contraining to the result of a constraint should yield the original result.
    307308    // Thus we look for dimensions that are one pixel shy of the max value and bump them up
    308     if ( isset( $did_width ) && $did_width && $w == $max_width - 1 )
     309    if ( $did_width && $w == $max_width - 1 )
    309310        $w = $max_width; // Round it up
    310     if ( isset( $did_height ) && $did_height && $h == $max_height - 1 )
     311    if ( $did_height && $h == $max_height - 1 )
    311312        $h = $max_height; // Round it up
    312313
Note: See TracChangeset for help on using the changeset viewer.