WordPress.org

Make WordPress Core

Changeset 10227


Ignore:
Timestamp:
12/19/08 07:04:18 (5 years ago)
Author:
ryan
Message:

Avoid division by zero

File:
1 edited

Legend:

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

    r10150 r10227  
    232232    $width_ratio = $height_ratio = 1.0; 
    233233 
    234     if ( $max_width > 0 && $current_width > $max_width ) 
     234    if ( $max_width > 0 && $current_width > 0 && $current_width > $max_width ) 
    235235        $width_ratio = $max_width / $current_width; 
    236236 
    237     if ( $max_height > 0 && $current_height > $max_height ) 
     237    if ( $max_height > 0 && $current_height > 0 && $current_height > $max_height ) 
    238238        $height_ratio = $max_height / $current_height; 
    239239 
Note: See TracChangeset for help on using the changeset viewer.