diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-30 17:46:07 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-30 17:46:07 +0000 |
commit | 006898584b668bc04aeff31f8180d048e6ca4071 (patch) | |
tree | 760b44188ab02261ba351de90e216e1b419fa87c /wp-includes/functions.php | |
parent | eeae9d5c09399fa7cb89fe52d5676bf18fa61457 (diff) | |
download | wordpress-mu-006898584b668bc04aeff31f8180d048e6ca4071.tar.gz wordpress-mu-006898584b668bc04aeff31f8180d048e6ca4071.tar.xz wordpress-mu-006898584b668bc04aeff31f8180d048e6ca4071.zip |
WP Merge to rev 3834 and reverted to novalueindb option code
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@873 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/functions.php')
-rw-r--r-- | wp-includes/functions.php | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 506de5a..e271370 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -203,16 +203,21 @@ function is_serialized_string($data) { function get_option($setting) { global $wpdb, $switched, $current_blog; + $pre = apply_filters( 'pre_option_' . $setting, false ); + if ( $pre ) + return $pre; + if ( $switched == false && defined('WP_INSTALLING') == false ) { - // prevent non-existent options from triggering multiple queries - if ( true === wp_cache_get($setting, 'notoptions') ) - return false; $value = wp_cache_get($setting, 'options'); } else { $value = false; wp_cache_delete($setting, 'options'); } +// Uncomment if we get any page not found or rewrite errors +// if( $setting == 'rewrite_rules' ) +// $value = false; + if ( $value == 'novalueindb' ) return false; if ( $value == 'emptystringindb' ) @@ -227,9 +232,9 @@ function get_option($setting) { if( is_object( $row) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values $value = $row->option_value; - wp_cache_set($setting, $value, 'options'); - } else { // option does not exist, so we must cache its non-existence - wp_cache_set($setting, true, 'notoptions'); + wp_cache_set($setting, ($value=='')?'emptystringindb':$value, 'options'); + } else { + wp_cache_set($setting, 'novalueindb', 'options'); return false; } } @@ -290,9 +295,6 @@ function update_option($option_name, $newvalue) { return true; } - if ( true === wp_cache_get($option_name, 'notoptions') ) - wp_cache_delete($option_name, 'notoptions'); - $_newvalue = $newvalue; $newvalue = maybe_serialize($newvalue); @@ -1211,7 +1213,7 @@ function wp_nonce_ays($action) { $adminurl = get_option('siteurl') . '/wp-admin'; if ( wp_get_referer() ) - $adminurl = wp_get_referer(); + $adminurl = wp_specialchars(wp_get_referer(), 1); $title = __('WordPress Confirmation'); // Remove extra layer of slashes. |