Skip to:
Content

bbPress.org


Ignore:
Timestamp:
05/19/2017 03:25:37 AM (7 years ago)
Author:
johnjamesjacoby
Message:

in_array(): be strict whenever possible.

Use wp_parse_id_list() on certain array values to ensure proper results.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/functions.php

    r6400 r6415  
    12131213
    12141214                // Loop detection: If the ancestor has been seen before, break.
    1215                 if ( empty( $ancestor->post_parent ) || ( $grampy_id === $reply_id ) || in_array( $grampy_id, $ancestors ) ) {
     1215                if ( empty( $ancestor->post_parent ) || ( $grampy_id === $reply_id ) || in_array( $grampy_id, $ancestors, true ) ) {
    12161216                    break;
    12171217                }
     
    13521352
    13531353    // Invalid move option
    1354     if ( empty( $move_option ) || ! in_array( $move_option, array( 'existing', 'topic' ) ) ) {
     1354    if ( empty( $move_option ) || ! in_array( $move_option, array( 'existing', 'topic' ), true ) ) {
    13551355        bbp_add_error( 'bbp_move_reply_option', __( '<strong>ERROR</strong>: You need to choose a valid move option.', 'bbpress' ) );
    13561356
Note: See TracChangeset for help on using the changeset viewer.