Make WordPress Core


Ignore:
Timestamp:
02/17/2024 03:22:37 PM (14 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/comment.php

    r57644 r57648  
    10321032    }
    10331033
    1034     return $count;
     1034    return (int) $count;
    10351035}
    10361036
     
    11711171            // Divide comments older than this one by comments per page to get this comment's page number.
    11721172        } else {
    1173             $page = ceil( ( $older_comment_count + 1 ) / $args['per_page'] );
     1173            $page = (int) ceil( ( $older_comment_count + 1 ) / $args['per_page'] );
    11741174        }
    11751175    }
Note: See TracChangeset for help on using the changeset viewer.