Changeset 50936 for trunk/src/wp-includes/bookmark.php
- Timestamp:
- 05/20/2021 12:03:04 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/bookmark.php
r50558 r50936 392 392 * @param mixed $value The bookmark field value. 393 393 * @param int $bookmark_id Bookmark ID. 394 * @param string $context How to filter the field value. Accepts 'raw', 'edit', ' attribute',395 * ' js', 'db', or 'display'394 * @param string $context How to filter the field value. Accepts 'raw', 'edit', 'db', 395 * 'display', 'attribute', or 'js'. Default 'display'. 396 396 * @return mixed The filtered value. 397 397 */ 398 398 function sanitize_bookmark_field( $field, $value, $bookmark_id, $context ) { 399 $int_fields = array( 'link_id', 'link_rating' ); 400 if ( in_array( $field, $int_fields, true ) ) { 401 $value = (int) $value; 402 } 403 399 404 switch ( $field ) { 400 case 'link_id': // ints401 case 'link_rating':402 $value = (int) $value;403 break;404 405 case 'link_category': // array( ints ) 405 406 $value = array_map( 'absint', (array) $value ); … … 446 447 } 447 448 449 // Restore the type for integer fields after esc_attr(). 450 if ( in_array( $field, $int_fields, true ) ) { 451 $value = (int) $value; 452 } 453 448 454 return $value; 449 455 }
Note: See TracChangeset
for help on using the changeset viewer.