Changeset 56137
- Timestamp:
- 07/05/2023 10:44:20 AM (17 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-list-util.php
r55908 r56137 117 117 if ( is_array( $obj ) ) { 118 118 // Treat object as an array. 119 if ( array_key_exists( $m_key, $obj ) && ( $m_value === $obj[ $m_key ] ) ) { 119 if ( array_key_exists( $m_key, $obj ) 120 && ( (string) $m_value === (string) $obj[ $m_key ] ) 121 ) { 120 122 $matched++; 121 123 } 122 124 } elseif ( is_object( $obj ) ) { 123 125 // Treat object as an object. 124 if ( isset( $obj->{$m_key} ) && ( $m_value === $obj->{$m_key} ) ) { 126 if ( isset( $obj->{$m_key} ) 127 && ( (string) $m_value === (string) $obj->{$m_key} ) 128 ) { 125 129 $matched++; 126 130 } … … 277 281 } 278 282 279 if ( $a[ $field ] ===$b[ $field ] ) {283 if ( (string) $a[ $field ] === (string) $b[ $field ] ) { 280 284 continue; 281 285 } -
trunk/tests/phpunit/tests/functions/wpListFilter.php
r55562 r56137 211 211 ), 212 212 ), 213 'string to int comparison' => array( 214 array( 215 (object) array( 216 'foo' => '1', 217 ), 218 ), 219 array( 'foo' => 1 ), 220 'AND', 221 array( 222 0 => (object) array( 223 'foo' => '1', 224 ), 225 ), 226 ), 213 227 ); 214 228 }
Note: See TracChangeset
for help on using the changeset viewer.