Make WordPress Core

Ticket #33710: 33710.patch

File 33710.patch, 2.0 KB (added by rachelbaker, 10 years ago)
  • src/wp-admin/edit-form-comment.php

     
    119119<?php
    120120if ( $comment->comment_parent ) :
    121121        $parent      = get_comment( $comment->comment_parent );
    122         $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
    123         $name        = get_comment_author( $parent->comment_ID );
    124 ?>
    125 <div class="misc-pub-section misc-pub-reply-to">
    126         <?php printf(
    127                 /* translators: comment link */
    128                 __( 'In reply to: %s' ),
    129                 '<b><a href="' . $parent_link . '">' . $name . '</a></b>'
    130         ); ?>
    131 </div>
    132 <?php endif; ?>
     122        if ( $parent ) :
     123                $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
     124                $name        = esc_attr( get_comment_author( $parent->comment_ID ) );
     125        ?>
     126        <div class="misc-pub-section misc-pub-reply-to">
     127                <?php printf(
     128                        /* translators: comment link */
     129                        __( 'In reply to: %s' ),
     130                        '<b><a href="' . $parent_link . '">' . $name . '</a></b>'
     131                ); ?>
     132        </div>
     133<?php endif;
     134endif; ?>
    133135
    134136<?php
    135137        /**
  • src/wp-admin/includes/class-wp-comments-list-table.php

     
    604604
    605605                if ( $comment->comment_parent ) {
    606606                        $parent = get_comment( $comment->comment_parent );
    607                         $parent_link = esc_url( get_comment_link( $comment->comment_parent ) );
    608                         $name = get_comment_author( $parent->comment_ID );
    609                         printf( ' | '.__( 'In reply to <a href="%1$s">%2$s</a>.' ), $parent_link, $name );
     607                        if ( $parent ) {
     608                                $parent_link = get_comment_link( $comment->comment_parent );
     609                                $name = get_comment_author( $parent->comment_ID );
     610                                printf( ' | '.__( 'In reply to <a href="%1$s">%2$s</a>.' ),  esc_url( $parent_link ), esc_attr( $name ) );
     611                        }
    610612                }
    611613
    612614                echo '</div>';