From 33b99991a87510c444aaa73dda1c6ca907b437b8 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 21 May 2015 18:00:26 +0000 Subject: [PATCH] In `sanitize_option()`, pass the unsanitized `$value` to the filter. Props simonwheatley, MikeHansenMe. Fixes #26199. Built from https://develop.svn.wordpress.org/trunk@32520 git-svn-id: http://core.svn.wordpress.org/trunk@32490 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 10 +++++++--- wp-includes/version.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 9a2dce8637..28b29f4e37 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3328,6 +3328,8 @@ function wp_make_link_relative( $link ) { function sanitize_option($option, $value) { global $wpdb; + $original_value = $value; + switch ( $option ) { case 'admin_email' : case 'new_admin_email' : @@ -3515,11 +3517,13 @@ function sanitize_option($option, $value) { * Filter an option value following sanitization. * * @since 2.3.0 + * @since 4.3.0 Added the `$original_value` parameter. * - * @param string $value The sanitized option value. - * @param string $option The option name. + * @param string $value The sanitized option value. + * @param string $option The option name. + * @param string $original_value The original value passed to the function. */ - $value = apply_filters( "sanitize_option_{$option}", $value, $option ); + $value = apply_filters( "sanitize_option_{$option}", $value, $option, $original_value ); return $value; } diff --git a/wp-includes/version.php b/wp-includes/version.php index a91e00703a..f55de9d5f8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32519'; +$wp_version = '4.3-alpha-32520'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.