Make WordPress Core


Ignore:
Timestamp:
01/16/2019 06:04:51 AM (6 years ago)
Author:
pento
Message:

Formatting: Add type checking to _sanitize_text_fields().

When a non-string value is passed, return an empty string.

Props Mte90.
Fixes #41450.

File:
1 edited

Legend:

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

    r44579 r44618  
    51035103 */
    51045104function _sanitize_text_fields( $str, $keep_newlines = false ) {
     5105    if ( ! is_string( $str ) ) {
     5106        return '';
     5107    }
     5108
    51055109    $filtered = wp_check_invalid_utf8( $str );
    51065110
Note: See TracChangeset for help on using the changeset viewer.