Make WordPress Core

Ticket #59818: 59818.diff

File 59818.diff, 1.2 KB (added by SergeyBiryukov, 2 years ago)
  • src/wp-includes/formatting.php

     
    49614961                        break;
    49624962
    49634963                case 'ping_sites':
    4964                         $value = explode( "\n", $value );
     4964                        if ( is_string( $value ) ) {
     4965                                $value = explode( "\n", $value );
     4966                        } else {
     4967                                $value = array();
     4968                        }
     4969
    49654970                        $value = array_filter( array_map( 'trim', $value ) );
    49664971                        $value = array_filter( array_map( 'sanitize_url', $value ) );
    49674972                        $value = implode( "\n", $value );
  • tests/phpunit/tests/option/sanitizeOption.php

     
    4444                        array( 'date_format', 'F j, Y', 'F j, <strong>Y</strong>' ),
    4545                        array( 'ping_sites', 'http://rpc.pingomatic.com/', 'http://rpc.pingomatic.com/' ),
    4646                        array( 'ping_sites', "http://www.example.com\nhttp://example.org", "www.example.com \n\texample.org\n\n" ),
     47                        array( 'ping_sites', '', null ),
    4748                        array( 'gmt_offset', '0', 0 ),
    4849                        array( 'gmt_offset', '1.5', '1.5' ),
    4950                        array( 'gmt_offset', '', null ),