Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Andrew Nacin nacin authored
8 wp-admin/setup-config.php
@@ -44,12 +44,14 @@
44 44 require(ABSPATH . WPINC . '/load.php');
45 45 require(ABSPATH . WPINC . '/version.php');
46 46
47   -// Also loads functions.php, plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php)
48   -wp_load_translations_early();
49   -
50 47 // Check for the required PHP version and for the MySQL extension or a database drop-in.
51 48 wp_check_php_mysql_versions();
52 49
  50 +require_once(ABSPATH . WPINC . '/functions.php');
  51 +
  52 +// Also loads plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php)
  53 +wp_load_translations_early();
  54 +
53 55 // Turn register_globals off.
54 56 wp_unregister_GLOBALS();
55 57
5 wp-includes/load.php
@@ -105,12 +105,12 @@ function wp_check_php_mysql_versions() {
105 105 $php_version = phpversion();
106 106 if ( version_compare( $required_php_version, $php_version, '>' ) ) {
107 107 wp_load_translations_early();
108   - 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 ) );
  108 + 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 ) );
109 109 }
110 110
111 111 if ( ! extension_loaded( 'mysql' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
112 112 wp_load_translations_early();
113   - wp_die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
  113 + die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ) );
114 114 }
115 115 }
116 116
@@ -709,7 +709,6 @@ function wp_load_translations_early() {
709 709 require_once ABSPATH . WPINC . '/locale.php';
710 710
711 711 // General libraries
712   - require_once ABSPATH . WPINC . '/functions.php';
713 712 require_once ABSPATH . WPINC . '/plugin.php';
714 713
715 714 $locales = $locations = array();
4 wp-load.php
@@ -48,8 +48,10 @@
48 48 require_once( ABSPATH . WPINC . '/load.php' );
49 49 require_once( ABSPATH . WPINC . '/version.php' );
50 50
51   - wp_load_translations_early();
52 51 wp_check_php_mysql_versions();
  52 + wp_load_translations_early();
  53 +
  54 + require_once( ABSPATH . WPINC . '/functions.php' );
53 55
54 56 // Die with an error message
55 57 $die = __( "There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started." ) . '</p>';

0 comments on commit c97452d

Please sign in to comment.
Something went wrong with that request. Please try again.