Changeset 48822
- Timestamp:
- 08/19/2020 01:55:12 AM (4 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/misc.php
r48586 r48822 689 689 break; 690 690 default: 691 $screen_option = false;692 693 691 if ( '_page' === substr( $option, -5 ) || 'layout_columns' === $option ) { 694 692 /** … … 711 709 * @param int $value The option value. 712 710 */ 713 $screen_option = apply_filters( 'set-screen-option', $screen_option, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 711 $value = apply_filters( 'set-screen-option', false, $option, $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 712 } else { 713 /** 714 * Filters a screen option value before it is set. 715 * 716 * The dynamic portion of the hook, `$option`, refers to the option name. 717 * 718 * Returning false from the filter will skip saving the current option. 719 * 720 * @since 5.4.2 721 * @since 5.4.3 Only applied to options not ending with '_page', 722 * and not the 'layout_columns' option. 723 * 724 * @see set_screen_options() 725 * 726 * @param mixed $screen_option The value to save instead of the option value. 727 * Default false (to skip saving the current option). 728 * @param string $option The option name. 729 * @param int $value The option value. 730 */ 731 $value = apply_filters( "set_screen_option_{$option}", false, $option, $value ); 714 732 } 715 716 /**717 * Filters a screen option value before it is set.718 *719 * The dynamic portion of the hook, `$option`, refers to the option name.720 *721 * Returning false from the filter will skip saving the current option.722 *723 * @since 5.4.2724 *725 * @see set_screen_options()726 *727 * @param mixed $screen_option The value to save instead of the option value.728 * Default false (to skip saving the current option).729 * @param string $option The option name.730 * @param int $value The option value.731 */732 $value = apply_filters( "set_screen_option_{$option}", $screen_option, $option, $value );733 733 734 734 if ( false === $value ) { -
trunk/src/wp-includes/comment.php
r48748 r48822 2189 2189 $prefiltered_user_id = ( isset( $commentdata['user_id'] ) ) ? (int) $commentdata['user_id'] : 0; 2190 2190 2191 if ( ! isset( $commentdata['comment_author_IP'] ) ) { 2192 $commentdata['comment_author_IP'] = $_SERVER['REMOTE_ADDR']; 2193 } 2194 2195 if ( ! isset( $commentdata['comment_agent'] ) ) { 2196 $commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : ''; 2197 } 2198 2191 2199 /** 2192 2200 * Filters a comment's data before it is sanitized and inserted into the database. 2193 2201 * 2194 2202 * @since 1.5.0 2203 * @since 5.6.0 Comment data includes the `comment_agent` and `comment_author_IP` values. 2195 2204 * 2196 2205 * @param array $commentdata Comment data. … … 2212 2221 $commentdata['comment_parent'] = ( 'approved' === $parent_status || 'unapproved' === $parent_status ) ? $commentdata['comment_parent'] : 0; 2213 2222 2214 if ( ! isset( $commentdata['comment_author_IP'] ) ) {2215 $commentdata['comment_author_IP'] = $_SERVER['REMOTE_ADDR'];2216 }2217 2223 $commentdata['comment_author_IP'] = preg_replace( '/[^0-9a-fA-F:., ]/', '', $commentdata['comment_author_IP'] ); 2218 2224 2219 if ( ! isset( $commentdata['comment_agent'] ) ) {2220 $commentdata['comment_agent'] = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';2221 }2222 2225 $commentdata['comment_agent'] = substr( $commentdata['comment_agent'], 0, 254 ); 2223 2226
Note: See TracChangeset
for help on using the changeset viewer.