Make WordPress Core


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

    r56687 r57648  
    15161516            $top_level_count = $top_level_query->query( $top_level_args );
    15171517
    1518             $comment_args['offset'] = ( ceil( $top_level_count / $per_page ) - 1 ) * $per_page;
     1518            $comment_args['offset'] = ( (int) ceil( $top_level_count / $per_page ) - 1 ) * $per_page;
    15191519        }
    15201520    }
Note: See TracChangeset for help on using the changeset viewer.