diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-05-23 17:31:51 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2008-05-23 17:31:51 +0000 |
commit | 1c4354fd3d0fb51f54899cf4599aef5e9b7491ea (patch) | |
tree | df4cf1f71597a0f0e4c3db9e454e18d57e27db6c /wp-includes/functions.php | |
parent | b7a46d708e56cc838ec6faecd2fac2897650c43b (diff) | |
download | wordpress-mu-1c4354fd3d0fb51f54899cf4599aef5e9b7491ea.tar.gz wordpress-mu-1c4354fd3d0fb51f54899cf4599aef5e9b7491ea.tar.xz wordpress-mu-1c4354fd3d0fb51f54899cf4599aef5e9b7491ea.zip |
Experimental: warn if blog_id is changed without switch_to_blog() being called because it results in cache pollution
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1310 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/functions.php')
-rw-r--r-- | wp-includes/functions.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 51445a1..e12e2aa 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -203,9 +203,18 @@ function get_option( $setting ) { return $pre; if ( $switched != false || defined('WP_INSTALLING') != false ) { - wp_cache_delete($setting, 'options'); - wp_cache_delete('notoptions', 'options'); - wp_cache_delete('alloptions', 'options'); + global $blog_id, $switched_to; + if( $switched_to != $blog_id && function_exists('error_log') ) { + $msg = "{$_SERVER[ 'HTTP_HOST' ]}{$_SERVER[ 'REQUEST_URI' ]} blog_id changed without calling switch_to_blog(). Current value: $blog_id"; + if( defined( 'ERRORLOGFILE' ) ) { + error_log( $msg, 3, CONSTANT( 'ERRORLOGFILE' ) ); + } else { + error_log( $msg ); + } + } + //wp_cache_delete($setting, 'options'); + //wp_cache_delete('notoptions', 'options'); + //wp_cache_delete('alloptions', 'options'); } // prevent non-existent options from triggering multiple queries |