From 5de66efda6f2d95221506762534293784468d64b Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 21 May 2015 17:59:58 +0000 Subject: [PATCH] In `sanitize_option()`, pass the unsanitized `$value` to the filter. Props simonwheatley, MikeHansenMe. Fixes #26199. git-svn-id: https://develop.svn.wordpress.org/trunk@32520 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/formatting.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 719b0e4c9c..bc1d9fd25c 100644 --- a/src/wp-includes/formatting.php +++ b/src/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; }