[wp-trac] [WordPress Trac] #58878: Replace all instances of ctype_digit() with is_numeric()

WordPress Trac noreply at wordpress.org
Sun Jul 23 08:00:17 UTC 2023


#58878: Replace all instances of ctype_digit() with is_numeric()
----------------------------+----------------------
 Reporter:  rajinsharwar    |       Owner:  (none)
     Type:  defect (bug)    |      Status:  closed
 Priority:  normal          |   Milestone:  6.4
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:  invalid
 Keywords:  has-patch       |     Focuses:
----------------------------+----------------------
Changes (by costdev):

 * milestone:   => 6.4


Comment:

 Hi @rajinsharwar, welcome back to Trac and thanks for opening this ticket.

 A few thoughts:
 - As @ayeshrajans says, `ctype_digit()` and `is_numeric()` have different
 behaviour.
 - None of the patched uses of `ctype_digit()` in
 [https://core.trac.wordpress.org/attachment/ticket/58878/58878.diff
 58878.diff] are susceptible to the deprecation notice.
   1. This only runs if `! is_int( $key )`.
   2. This runs on the result of `trim( $output )`, which returns a string.
   3. `$value` is already cast to `string`.
 - The getID3 library is an external library. If changes are not specific
 to WordPress Core or particularly urgent, ideally they should be made on
 [https://github.com/JamesHeinrich/getID3 the getID3 repository] so all of
 its users benefit. If you see any issues in the current code there and
 open an issue, please drop it in here so others can find it. 🙂

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58878#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list