From 1847d7e85b604473ada8ec7cb186f77e4bd91c48 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Sat, 17 Nov 2012 13:20:57 +0000 Subject: [PATCH] Trim the option name in get_option() before calling the pre_option_$option filter, not after. props evansolomon. fixes #22358. git-svn-id: http://core.svn.wordpress.org/trunk@22633 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/option.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/option.php b/wp-includes/option.php index 7f41d15602..722d1f30d4 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -32,15 +32,15 @@ function get_option( $option, $default = false ) { global $wpdb; + $option = trim( $option ); + if ( empty( $option ) ) + return false; + // Allow plugins to short-circuit options. $pre = apply_filters( 'pre_option_' . $option, false ); if ( false !== $pre ) return $pre; - $option = trim($option); - if ( empty($option) ) - return false; - if ( defined( 'WP_SETUP_CONFIG' ) ) return false;