From ca5d586b8ef96e7199aaf3d138ce8b48b9996be0 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 19 Jul 2014 23:13:19 +0000 Subject: [PATCH] After [29200], switch back to using `static` vars instead of adding 2 `global`s, as per Sergey. Fixes #28697. git-svn-id: https://develop.svn.wordpress.org/trunk@29250 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/ms-default-constants.php | 6 ++---- tests/phpunit/tests/ms.php | 11 ----------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/wp-includes/ms-default-constants.php b/src/wp-includes/ms-default-constants.php index c8dd091c0a..0f7d0ff6d3 100644 --- a/src/wp-includes/ms-default-constants.php +++ b/src/wp-includes/ms-default-constants.php @@ -114,12 +114,10 @@ function ms_file_constants() { * we will have translations loaded and can trigger warnings easily. * * @since 3.0.0 - * - * @global boolean $subdomain_error - * @global boolean $subdomain_error_warn */ function ms_subdomain_constants() { - global $subdomain_error, $subdomain_error_warn; + static $subdomain_error = null; + static $subdomain_error_warn = null; if ( false === $subdomain_error ) { return; diff --git a/tests/phpunit/tests/ms.php b/tests/phpunit/tests/ms.php index 647f5eea49..185133d1e6 100644 --- a/tests/phpunit/tests/ms.php +++ b/tests/phpunit/tests/ms.php @@ -25,17 +25,6 @@ class Tests_MS extends WP_UnitTestCase { $wpdb->suppress_errors( $this->suppress ); } - /** - * @ticket 28697 - */ - function test_ms_subdomain_constants() { - global $subdomain_error; - - $this->assertFalse( $subdomain_error ); - ms_subdomain_constants(); - $this->assertFalse( $subdomain_error ); - } - function test_remove_user_from_blog() { $user1 = $this->factory->user->create_and_get(); $user2 = $this->factory->user->create_and_get();