Make WordPress Core

Ticket #46329: 46329.diff

File 46329.diff, 523 bytes (added by fclaussen, 7 years ago)

Suggested enhancement to the _sanitize_text_fields function

  • src/wp-includes/formatting.php

    diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
    index b5c4982141..6159af1e5b 100644
    a b function sanitize_textarea_field( $str ) { 
    51535153 * @return string Sanitized string.
    51545154 */
    51555155function _sanitize_text_fields( $str, $keep_newlines = false ) {
    5156         if ( is_object( $str ) || is_array( $str ) ) {
     5156        if ( ( is_object( $str ) && ! method_exists( $str, '__toString' ) ) || is_array( $str ) ) {
    51575157                return '';
    51585158        }
    51595159