Changeset 33021 for trunk/src/wp-includes/comment.php
- Timestamp:
- 07/01/2015 12:07:28 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/comment.php
r32964 r33021 2272 2272 * 2273 2273 * @since 1.5.0 2274 * @since 4.3.0 'comment_agent' and 'comment_author_IP' can be set via `$commentdata`. 2274 2275 * 2275 2276 * @see wp_insert_comment() … … 2310 2311 $commentdata['comment_parent'] = ( 'approved' == $parent_status || 'unapproved' == $parent_status ) ? $commentdata['comment_parent'] : 0; 2311 2312 2312 $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '',$_SERVER['REMOTE_ADDR'] ); 2313 $commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ) : ''; 2313 if ( ! isset( $commentdata['comment_author_IP'] ) ) { 2314 $commentdata['comment_author_IP'] = $_SERVER['REMOTE_ADDR']; 2315 } 2316 $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '', $commentdata['comment_author_IP'] ); 2317 2318 if ( ! isset( $commentdata['comment_agent'] ) ) { 2319 $commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT']: ''; 2320 } 2321 $commentdata['comment_agent'] = substr( $commentdata['comment_agent'], 0, 254 ); 2314 2322 2315 2323 if ( empty( $commentdata['comment_date'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.