Make WordPress Core

Changeset 28922


Ignore:
Timestamp:
06/30/2014 11:02:10 AM (11 years ago)
Author:
SergeyBiryukov
Message:

Avoid a PHP notice in wp_new_comment() if user ID is not passed.

see #23231.

File:
1 edited

Legend:

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

    r28915 r28922  
    17461746        $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];
    17471747    }
    1748     $prefiltered_user_id = $commentdata['user_id'];
     1748
     1749    $prefiltered_user_id = ( isset( $commentdata['user_id'] ) ) ? (int) $commentdata['user_id'] : 0;
    17491750
    17501751    /**
Note: See TracChangeset for help on using the changeset viewer.