Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't include functions.php in wp_load_translations_early()

to avoid a parse error in a PHP4 environment (caused by use of
the clone keyword in option.php).

Manually include functions.php in the rare situations where it
is not already included by the time we need to load translations
early.

Remove the functions.php dependency by switching the wp_die() calls
to die(), in wp_check_php_mysql_versions().

props SergeyBiryukov, see #21316, for trunk.




git-svn-id: http://core.svn.wordpress.org/trunk@21715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
commit c97452d95527d4fce4e695094c5d0ede13ea6538 1 parent 1635740
@nacin nacin authored
Showing with 10 additions and 7 deletions.
  1. +5 −3 wp-admin/setup-config.php
  2. +2 −3 wp-includes/load.php
  3. +3 −1 wp-load.php
View
8 wp-admin/setup-config.php
@@ -44,12 +44,14 @@
require(ABSPATH . WPINC . '/load.php');
require(ABSPATH . WPINC . '/version.php');
-// Also loads functions.php, plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php)
-wp_load_translations_early();
-
// Check for the required PHP version and for the MySQL extension or a database drop-in.
wp_check_php_mysql_versions();
+require_once(ABSPATH . WPINC . '/functions.php');
+
+// Also loads plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php)
+wp_load_translations_early();
+
// Turn register_globals off.
wp_unregister_GLOBALS();
View
5 wp-includes/load.php
@@ -105,12 +105,12 @@ function wp_check_php_mysql_versions() {
$php_version = phpversion();
if ( version_compare( $required_php_version, $php_version, '>' ) ) {
wp_load_translations_early();
- wp_die( sprintf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version ) );
+ die( sprintf( __( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.' ), $php_version, $wp_version, $required_php_version ) );
}
if ( ! extension_loaded( 'mysql' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
wp_load_translations_early();
- wp_die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
+ die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
}
}
@@ -709,7 +709,6 @@ function wp_load_translations_early() {
require_once ABSPATH . WPINC . '/locale.php';
// General libraries
- require_once ABSPATH . WPINC . '/functions.php';
require_once ABSPATH . WPINC . '/plugin.php';
$locales = $locations = array();
View
4 wp-load.php
@@ -48,8 +48,10 @@
require_once( ABSPATH . WPINC . '/load.php' );
require_once( ABSPATH . WPINC . '/version.php' );
- wp_load_translations_early();
wp_check_php_mysql_versions();
+ wp_load_translations_early();
+
+ require_once( ABSPATH . WPINC . '/functions.php' );
// Die with an error message
$die = __( "There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started." ) . '</p>';
Please sign in to comment.
Something went wrong with that request. Please try again.