From 09340de73e4448ce4649e2c7126b0d4173c011d8 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Tue, 9 Jun 2015 17:58:18 +0000 Subject: [PATCH] Add error if a user attempts to install WordPress with DO_NOT_UPGRADE_GLOBAL_TABLES defined The install process runs through migrations to global tables, therefore we cannot install WordPress with this constant defined. This error message prevents a false success screen from being seen. Fixes #32011. Props Oxymoron. git-svn-id: https://develop.svn.wordpress.org/trunk@32714 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/install.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index 8d7e947a8f..6858661662 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -193,6 +193,12 @@ if ( ! is_string( $wpdb->base_prefix ) || '' === $wpdb->base_prefix ) { die( '

' . __( 'Configuration Error' ) . '

' . __( 'Your wp-config.php file has an empty database table prefix, which is not supported.' ) . '

' ); } +// Set error message if DO_NOT_UPGRADE_GLOBAL_TABLES isn't set as it will break install. +if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && true === DO_NOT_UPGRADE_GLOBAL_TABLES ) { + display_header(); + die( '

' . __( 'Configuration Error' ) . '

' . __( 'The constant DO_NOT_UPGRADE_GLOBAL_TABLES cannot be defined when installing WordPress.' ) . '

' ); +} + /** * @global string $wp_local_package * @global WP_Locale $wp_locale