<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[57648] trunk/src: General: Consistently cast return value to `int` in functions that use `ceil()`.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/57648">57648</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/57648","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>swissspidy</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2024-02-17 15:22:37 +0000 (Sat, 17 Feb 2024)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>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 <a href="https://core.trac.wordpress.org/ticket/58683">#58683</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesajaxactionsphp">trunk/src/wp-admin/includes/ajax-actions.php</a></li>
<li><a href="#trunksrcwpadminincludesclasswplisttablephp">trunk/src/wp-admin/includes/class-wp-list-table.php</a></li>
<li><a href="#trunksrcwpadminincludesmediaphp">trunk/src/wp-admin/includes/media.php</a></li>
<li><a href="#trunksrcwpadminincludesnavmenuphp">trunk/src/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcommentqueryphp">trunk/src/wp-includes/class-wp-comment-query.php</a></li>
<li><a href="#trunksrcwpincludesclasswpnetworkqueryphp">trunk/src/wp-includes/class-wp-network-query.php</a></li>
<li><a href="#trunksrcwpincludesclasswpqueryphp">trunk/src/wp-includes/class-wp-query.php</a></li>
<li><a href="#trunksrcwpincludesclasswpsitequeryphp">trunk/src/wp-includes/class-wp-site-query.php</a></li>
<li><a href="#trunksrcwpincludesclasswpwalkerphp">trunk/src/wp-includes/class-wp-walker.php</a></li>
<li><a href="#trunksrcwpincludescommenttemplatephp">trunk/src/wp-includes/comment-template.php</a></li>
<li><a href="#trunksrcwpincludescommentphp">trunk/src/wp-includes/comment.php</a></li>
<li><a href="#trunksrcwpincludesembedphp">trunk/src/wp-includes/embed.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestcommentscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestfontcollectionscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestglobalstylesrevisionscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestpostscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestrevisionscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestsearchcontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswpresttermscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php</a></li>
<li><a href="#trunksrcwpincludesrestapiendpointsclasswprestuserscontrollerphp">trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesajaxactionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ajax-actions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ajax-actions.php      2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-admin/includes/ajax-actions.php        2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -561,8 +561,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'postId'               => $comment ? $comment->comment_post_ID : '',
</span><span class="cx" style="display: block; padding: 0 10px">                                /* translators: %s: Number of comments. */
</span><span class="cx" style="display: block; padding: 0 10px">                                'total_items_i18n'     => sprintf( _n( '%s item', '%s items', $total ), number_format_i18n( $total ) ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                'total_pages'          => ceil( $total / $per_page ),
-                               'total_pages_i18n'     => number_format_i18n( ceil( $total / $per_page ) ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         'total_pages'          => (int) ceil( $total / $per_page ),
+                               'total_pages_i18n'     => number_format_i18n( (int) ceil( $total / $per_page ) ),
</ins><span class="cx" style="display: block; padding: 0 10px">                                 'total'                => $total,
</span><span class="cx" style="display: block; padding: 0 10px">                                'time'                 => $time,
</span><span class="cx" style="display: block; padding: 0 10px">                                'in_moderation'        => $counts->moderated,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3089,10 +3089,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $posts_per_page = (int) $attachments_query->get( 'posts_per_page' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $max_pages = $posts_per_page ? ceil( $total_posts / $posts_per_page ) : 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $max_pages = $posts_per_page ? (int) ceil( $total_posts / $posts_per_page ) : 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        header( 'X-WP-Total: ' . (int) $total_posts );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        header( 'X-WP-TotalPages: ' . (int) $max_pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ header( 'X-WP-TotalPages: ' . $max_pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        wp_send_json_success( $posts );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminincludesclasswplisttablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/class-wp-list-table.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/class-wp-list-table.php       2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-admin/includes/class-wp-list-table.php 2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -319,7 +319,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! $args['total_pages'] && $args['per_page'] > 0 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $args['total_pages'] = (int) ceil( $args['total_items'] / $args['per_page'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Redirect if page number is invalid and headers are not already sent.
</span></span></pre></div>
<a id="trunksrcwpadminincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/media.php     2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-admin/includes/media.php       2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2832,7 +2832,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                                'format'    => '',
</span><span class="cx" style="display: block; padding: 0 10px">                                'prev_text' => __( '&laquo;' ),
</span><span class="cx" style="display: block; padding: 0 10px">                                'next_text' => __( '&raquo;' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                'total'     => ceil( $wp_query->found_posts / 10 ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         'total'     => (int) ceil( $wp_query->found_posts / 10 ),
</ins><span class="cx" style="display: block; padding: 0 10px">                                 'current'   => $q['paged'],
</span><span class="cx" style="display: block; padding: 0 10px">                        )
</span><span class="cx" style="display: block; padding: 0 10px">                );
</span></span></pre></div>
<a id="trunksrcwpadminincludesnavmenuphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/nav-menu.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/nav-menu.php  2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-admin/includes/nav-menu.php    2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -874,7 +874,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $num_pages = ceil(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $num_pages = (int) ceil(
</ins><span class="cx" style="display: block; padding: 0 10px">                 wp_count_terms(
</span><span class="cx" style="display: block; padding: 0 10px">                        array_merge(
</span><span class="cx" style="display: block; padding: 0 10px">                                $args,
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpcommentqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-comment-query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-comment-query.php  2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/class-wp-comment-query.php    2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -470,7 +470,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $this->found_comments && $this->query_vars['number'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->max_num_pages = ceil( $this->found_comments / $this->query_vars['number'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $this->max_num_pages = (int) ceil( $this->found_comments / $this->query_vars['number'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // If querying for a count only, there's nothing more to do.
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpnetworkqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-network-query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-network-query.php  2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/class-wp-network-query.php    2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -269,7 +269,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $this->found_networks && $this->query_vars['number'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->max_num_pages = ceil( $this->found_networks / $this->query_vars['number'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $this->max_num_pages = (int) ceil( $this->found_networks / $this->query_vars['number'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // If querying for a count only, there's nothing more to do.
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpqueryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-query.php  2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/class-wp-query.php    2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3624,7 +3624,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $this->found_posts = (int) apply_filters_ref_array( 'found_posts', array( $this->found_posts, &$this ) );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( ! empty( $limits ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->max_num_pages = ceil( $this->found_posts / $q['posts_per_page'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $this->max_num_pages = (int) ceil( $this->found_posts / $q['posts_per_page'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpsitequeryphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-site-query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-site-query.php     2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/class-wp-site-query.php       2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -377,7 +377,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $this->found_sites && $this->query_vars['number'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->max_num_pages = ceil( $this->found_sites / $this->query_vars['number'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $this->max_num_pages = (int) ceil( $this->found_sites / $this->query_vars['number'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // If querying for a count only, there's nothing more to do.
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpwalkerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-walker.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-walker.php 2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/class-wp-walker.php   2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -310,7 +310,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $start  = ( (int) $page_num - 1 ) * (int) $per_page;
</span><span class="cx" style="display: block; padding: 0 10px">                        $end    = $start + $per_page;
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( -1 == $max_depth ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $this->max_pages = ceil( $total_top / $per_page );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $this->max_pages = (int) ceil( $total_top / $per_page );
</ins><span class="cx" style="display: block; padding: 0 10px">                         }
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -354,7 +354,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $total_top = count( $top_level_elements );
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $paging ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $this->max_pages = ceil( $total_top / $per_page );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $this->max_pages = (int) ceil( $total_top / $per_page );
</ins><span class="cx" style="display: block; padding: 0 10px">                 } else {
</span><span class="cx" style="display: block; padding: 0 10px">                        $end = $total_top;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span></span></pre></div>
<a id="trunksrcwpincludescommenttemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/comment-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment-template.php        2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/comment-template.php  2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1515,7 +1515,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $top_level_count = $top_level_query->query( $top_level_args );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $comment_args['offset'] = ( ceil( $top_level_count / $per_page ) - 1 ) * $per_page;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $comment_args['offset'] = ( (int) ceil( $top_level_count / $per_page ) - 1 ) * $per_page;
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpincludescommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment.php 2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/comment.php   2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1031,7 +1031,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $count = ceil( count( $comments ) / $per_page );
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        return $count;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return (int) $count;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1170,7 +1170,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        // Divide comments older than this one by comments per page to get this comment's page number.
</span><span class="cx" style="display: block; padding: 0 10px">                } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $page = ceil( ( $older_comment_count + 1 ) / $args['per_page'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $page = (int) ceil( ( $older_comment_count + 1 ) / $args['per_page'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span></span></pre></div>
<a id="trunksrcwpincludesembedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/embed.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/embed.php   2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/embed.php     2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,7 +73,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $width = 500;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $height = min( ceil( $width * 1.5 ), 1000 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $height = min( (int) ceil( $width * 1.5 ), 1000 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        /**
</span><span class="cx" style="display: block; padding: 0 10px">         * Filters the default array of embed dimensions.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -577,7 +577,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $width  = min( max( $min_max_width['min'], $width ), $min_max_width['max'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        $height = max( ceil( $width / 16 * 9 ), 200 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $height = max( (int) ceil( $width / 16 * 9 ), 200 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        $data = array(
</span><span class="cx" style="display: block; padding: 0 10px">                'version'       => '1.0',
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestcommentscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php    2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php      2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -300,7 +300,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $prepared_args['orderby'] = 'none';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        $total_comments = $query->query( $prepared_args );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        $max_pages      = ceil( $total_comments / $request['per_page'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 $max_pages      = (int) ceil( $total_comments / $request['per_page'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                 }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $response = rest_ensure_response( $comments );
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestfontcollectionscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php    2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-font-collections-controller.php      2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -77,7 +77,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $page        = $request['page'];
</span><span class="cx" style="display: block; padding: 0 10px">                $per_page    = $request['per_page'];
</span><span class="cx" style="display: block; padding: 0 10px">                $total_items = count( $collections_all );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $max_pages   = ceil( $total_items / $per_page );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $max_pages   = (int) ceil( $total_items / $per_page );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $page > $max_pages && $total_items > 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return new WP_Error(
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestglobalstylesrevisionscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php     2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php       2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -206,7 +206,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $revisions_query->query_vars['posts_per_page'] > 0 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $max_pages = ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $max_pages = (int) ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                         } else {
</span><span class="cx" style="display: block; padding: 0 10px">                                $max_pages = $total_revisions > 0 ? 1 : 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestpostscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php       2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php 2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -403,7 +403,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $total_posts = $count_query->found_posts;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $max_pages = ceil( $total_posts / (int) $posts_query->query_vars['posts_per_page'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $max_pages = (int) ceil( $total_posts / (int) $posts_query->query_vars['posts_per_page'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $page > $max_pages && $total_posts > 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return new WP_Error(
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestrevisionscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php   2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php     2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -308,7 +308,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                        if ( $revisions_query->query_vars['posts_per_page'] > 0 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                $max_pages = ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         $max_pages = (int) ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] );
</ins><span class="cx" style="display: block; padding: 0 10px">                         } else {
</span><span class="cx" style="display: block; padding: 0 10px">                                $max_pages = $total_revisions > 0 ? 1 : 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        }
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestsearchcontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php      2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-search-controller.php        2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -152,7 +152,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">                $total     = (int) $result[ WP_REST_Search_Handler::RESULT_TOTAL ];
</span><span class="cx" style="display: block; padding: 0 10px">                $page      = (int) $request['page'];
</span><span class="cx" style="display: block; padding: 0 10px">                $per_page  = (int) $request['per_page'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $max_pages = ceil( $total / $per_page );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $max_pages = (int) ceil( $total / $per_page );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $page > $max_pages && $total > 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px">                        return new WP_Error(
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswpresttermscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php       2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php 2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -348,13 +348,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Store pagination values for headers.
</span><span class="cx" style="display: block; padding: 0 10px">                $per_page = (int) $prepared_args['number'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page     = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page     = (int) ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $response->header( 'X-WP-Total', (int) $total_terms );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $max_pages = ceil( $total_terms / $per_page );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $max_pages = (int) ceil( $total_terms / $per_page );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $response->header( 'X-WP-TotalPages', (int) $max_pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $response->header( 'X-WP-TotalPages', $max_pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $request_params = $request->get_query_params();
</span><span class="cx" style="display: block; padding: 0 10px">                $collection_url = rest_url( rest_get_route_for_taxonomy_items( $this->taxonomy ) );
</span></span></pre></div>
<a id="trunksrcwpincludesrestapiendpointsclasswprestuserscontrollerphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php       2024-02-17 13:23:28 UTC (rev 57647)
+++ trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php 2024-02-17 15:22:37 UTC (rev 57648)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -348,7 +348,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                // Store pagination values for headers then unset for count query.
</span><span class="cx" style="display: block; padding: 0 10px">                $per_page = (int) $prepared_args['number'];
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $page     = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $page     = (int) ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $prepared_args['fields'] = 'ID';
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -363,9 +363,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $response->header( 'X-WP-Total', (int) $total_users );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $max_pages = ceil( $total_users / $per_page );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $max_pages = (int) ceil( $total_users / $per_page );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $response->header( 'X-WP-TotalPages', (int) $max_pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         $response->header( 'X-WP-TotalPages', $max_pages );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) );
</span><span class="cx" style="display: block; padding: 0 10px">                if ( $page > 1 ) {
</span></span></pre>
</div>
</div>

</body>
</html>