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
This commit is contained in:
Andrew Nacin 2012-11-17 13:20:57 +00:00
parent dc0786c0ae
commit 1847d7e85b
1 changed files with 4 additions and 4 deletions

View File

@ -32,15 +32,15 @@
function get_option( $option, $default = false ) { function get_option( $option, $default = false ) {
global $wpdb; global $wpdb;
$option = trim( $option );
if ( empty( $option ) )
return false;
// Allow plugins to short-circuit options. // Allow plugins to short-circuit options.
$pre = apply_filters( 'pre_option_' . $option, false ); $pre = apply_filters( 'pre_option_' . $option, false );
if ( false !== $pre ) if ( false !== $pre )
return $pre; return $pre;
$option = trim($option);
if ( empty($option) )
return false;
if ( defined( 'WP_SETUP_CONFIG' ) ) if ( defined( 'WP_SETUP_CONFIG' ) )
return false; return false;