Make WordPress Core


Ignore:
Timestamp:
02/17/2024 03:22:37 PM (8 months ago)
Author:
swissspidy
Message:

General: Consistently cast return value to int in functions that use ceil().

The return value of ceil() is still of type float as the value range of float is usually bigger than that of int.

Props crstauf, audrasjb.
Fixes #58683.

File:
1 edited

Legend:

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

    r56682 r57648  
    7474    }
    7575
    76     $height = min( ceil( $width * 1.5 ), 1000 );
     76    $height = min( (int) ceil( $width * 1.5 ), 1000 );
    7777
    7878    /**
     
    578578
    579579    $width  = min( max( $min_max_width['min'], $width ), $min_max_width['max'] );
    580     $height = max( ceil( $width / 16 * 9 ), 200 );
     580    $height = max( (int) ceil( $width / 16 * 9 ), 200 );
    581581
    582582    $data = array(
Note: See TracChangeset for help on using the changeset viewer.