Changeset 29797 for trunk/src/wp-includes/date.php
- Timestamp:
- 09/30/2014 02:03:49 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/date.php
r29479 r29797 314 314 case 'IN': 315 315 case 'NOT IN': 316 return '(' . implode( ',', array_map( 'intval', (array) $value ) ) . ')'; 316 $value = (array) $value; 317 318 // Remove non-numeric values. 319 $value = array_filter( $value, 'is_numeric' ); 320 321 if ( empty( $value ) ) { 322 return false; 323 } 324 325 return '(' . implode( ',', array_map( 'intval', $value ) ) . ')'; 317 326 318 327 case 'BETWEEN': 319 328 case 'NOT BETWEEN': 320 if ( ! is_array( $value ) || 2 != count( $value ) || ! isset( $value[0] ) || ! isset( $value[1] ) )329 if ( ! is_array( $value ) || 2 != count( $value ) ) { 321 330 $value = array( $value, $value ); 331 } else { 332 $value = array_values( $value ); 333 } 334 335 // If either value is non-numeric, bail. 336 foreach ( $value as $v ) { 337 if ( ! is_numeric( $v ) ) { 338 return false; 339 } 340 } 322 341 323 342 $value = array_map( 'intval', $value ); … … 326 345 327 346 default; 347 if ( ! is_numeric( $value ) ) { 348 return false; 349 } 350 328 351 return (int) $value; 329 352 }
Note: See TracChangeset
for help on using the changeset viewer.