Make WordPress Core


Ignore:
Timestamp:
09/10/2015 08:50:12 PM (11 years ago)
Author:
wonderboymusic
Message:

Comments/PHP Notices: check that a parent comment exists before displaying an orphan's link to it in the admin.

Props rachelbaker.
Fixes #33710.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-comments-list-table.php

    r33986 r34015  
    608608                if ( $comment->comment_parent ) {
    609609                        $parent = get_comment( $comment->comment_parent );
    610                         $parent_link = esc_url( get_comment_link( $parent ) );
    611                         $name = get_comment_author( $parent );
    612                         printf( ' | '.__( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
     610                        if ( $parent ) {
     611                                $parent_link = esc_url( get_comment_link( $parent ) );
     612                                $name = get_comment_author( $parent );
     613                                printf( ' | '.__( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
     614                        }
    613615                }
    614616
Note: See TracChangeset for help on using the changeset viewer.