Make WordPress Core


Ignore:
Timestamp:
10/15/2021 02:03:38 AM (3 years ago)
Author:
rachelbaker
Message:

REST API: Add text-field and textarea-field as available schema formats for string sanitization.

Props ocean90, TimothyBlynJacobs.
Fixes #49960.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api.php

    r51657 r51908  
    26362636 * @since 5.5.0 Added the `$param` parameter.
    26372637 * @since 5.6.0 Support the "anyOf" and "oneOf" keywords.
     2638 * @since 5.9.0 Added `text-field` and `textarea-field` formats.
    26382639 *
    26392640 * @param mixed  $value The value to sanitize.
     
    27782779            case 'uuid':
    27792780                return sanitize_text_field( $value );
     2781
     2782            case 'text-field':
     2783                return sanitize_text_field( $value );
     2784
     2785            case 'textarea-field':
     2786                return sanitize_textarea_field( $value );
    27802787        }
    27812788    }
Note: See TracChangeset for help on using the changeset viewer.