Make WordPress Core

Opened 5 months ago

Last modified 5 months ago

#58683 new defect (bug)

Cast return value to int in functions that use ceil()

Reported by: crstauf's profile crstauf Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:


The use-case expects an integer to be returned, but the count() function returns a float; cast the returned value to an integer.

  • get_comment_pages_count()
  • wp_embed_defaults()
  • get_oembed_response_data()

This was mentioned by Sergey in, and subsequent ticket #56800 aimed to update the tests, but the functions do not appear to have been fixed.

Change History (2)

This ticket was mentioned in PR #4768 on WordPress/wordpress-develop by @crstauf.

5 months ago

  • Keywords has-patch added

Handful of functions use ceil(), which returns a float, but the functions expect an integer. Change those functions to cast ceil() to an integer.

Trac ticket:

#2 @crstauf
5 months ago

Reported by @wileycoyote78 in User Contributed Notes.

Note: See TracTickets for help on using tickets.