]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-comment.php
WordPress 4.7.1-scripts
[autoinstalls/wordpress.git] / wp-includes / class-wp-comment.php
index 6319ad476476942c15863afdb504e4d829e8aa02..80ef9bb1d33b47e70b0f04f88693788b2989a86b 100644 (file)
@@ -33,7 +33,7 @@ final class WP_Comment {
        public $comment_post_ID = 0;
 
        /**
-        * Comment author ID.
+        * Comment author name.
         *
         * @since 4.4.0
         * @access public
@@ -191,11 +191,12 @@ final class WP_Comment {
        public static function get_instance( $id ) {
                global $wpdb;
 
-               $comment_id = (int) $id;
-               if ( ! $comment_id ) {
+               if ( ! is_numeric( $id ) || $id != floor( $id ) || ! $id ) {
                        return false;
                }
 
+               $comment_id = (int) $id;
+
                $_comment = wp_cache_get( $comment_id, 'comment' );
 
                if ( ! $_comment ) {
@@ -350,6 +351,8 @@ final class WP_Comment {
         * unneeded database queries.
         *
         * @since 4.4.0
+        *
+        * @param bool $set Whether the comment's children have already been populated.
         */
        public function populated_children( $set ) {
                $this->populated_children = (bool) $set;