Make WordPress Core


Ignore:
Timestamp:
09/23/2015 02:08:47 PM (11 years ago)
Author:
boonebgorges
Message:

Bail early when invalid ID is passed to get_comment_class().

This helps to avoid PHP notices later in the function.

Props walterebert, dipesh.kakadiya, DrewAPicture.
Fixes #33947.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/comment-template.php

    r34308 r34454  
    434434        global $comment_alt, $comment_depth, $comment_thread_alt;
    435435
    436         $comment = get_comment($comment_id);
    437 
    438436        $classes = array();
     437
     438        $comment = get_comment( $comment_id );
     439        if ( ! $comment ) {
     440                return $classes;
     441        }
    439442
    440443        // Get the comment type (comment, trackback),
Note: See TracChangeset for help on using the changeset viewer.