WordPress.org

Make WordPress Core

Ticket #17968: 17968.diff

File 17968.diff, 1.1 KB (added by wpmuguru, 7 years ago)
  • wp-includes/formatting.php

     
    431431 * @return string The checked text.
    432432 */
    433433function wp_check_invalid_utf8( $string, $strip = false ) {
     434        if( is_wp_error( $string ) )
     435                $string = '';
     436
    434437        $string = (string) $string;
    435438
    436439        if ( 0 === strlen( $string ) ) {
  • wp-includes/nav-menu.php

     
    605605                                $menu_item->url = !is_wp_error( $term_url ) ? $term_url : '';
    606606
    607607                                $original_title = get_term_field( 'name', $menu_item->object_id, $menu_item->object, 'raw' );
    608                                 $menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;
     608                                $menu_item->title = '' == $menu_item->post_title && !is_wp_error( $original_title ) ? $original_title : $menu_item->post_title;
    609609
    610610                        } else {
    611611                                $menu_item->type_label = __('Custom');