]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-comment.php
WordPress 4.7.2-scripts
[autoinstalls/wordpress.git] / wp-includes / class-wp-comment.php
index 80ef9bb1d33b47e70b0f04f88693788b2989a86b..0e9f88a352af3e8be7ec80373ed70b9e8b750f79 100644 (file)
@@ -191,12 +191,11 @@ final class WP_Comment {
        public static function get_instance( $id ) {
                global $wpdb;
 
-               if ( ! is_numeric( $id ) || $id != floor( $id ) || ! $id ) {
+               $comment_id = (int) $id;
+               if ( ! $comment_id ) {
                        return false;
                }
 
-               $comment_id = (int) $id;
-
                $_comment = wp_cache_get( $comment_id, 'comment' );
 
                if ( ! $_comment ) {