Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/12/2024 01:28:59 PM (3 years ago)
Author:
espellcaste
Message:

Cast values used in the ctype_digit function to a string.

Argument of type int will be interpreted as string in the future.

Closes ​https://github.com/buddypress/buddypress/pull/265
See #8649
Fixes #9125

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-attachments.php

    r13468 r13793  
    15741574        }
    15751575
    1576         if ( empty( $_POST['object'] ) || empty( $_POST['item_id'] ) || ( ! ctype_digit( $_POST['item_id'] ) && ! is_int( $_POST['item_id'] ) ) ) {
     1576        if ( empty( $_POST['object'] ) || empty( $_POST['item_id'] ) || ( ! ctype_digit( (string) $_POST['item_id'] ) && ! is_int( $_POST['item_id'] ) ) ) {
    15771577                wp_send_json_error();
    15781578        }
Note: See TracChangeset for help on using the changeset viewer.