Make WordPress Core

Ticket #21316: 21316.5.patch

File 21316.5.patch, 3.5 KB (added by SergeyBiryukov, 12 years ago)
  • wp-admin/setup-config.php

     
    5454wp_unregister_GLOBALS();
    5555
    5656require_once(ABSPATH . WPINC . '/compat.php');
     57require_once(ABSPATH . WPINC . '/functions.php');
    5758require_once(ABSPATH . WPINC . '/class-wp-error.php');
    5859require_once(ABSPATH . WPINC . '/formatting.php');
    5960
     
    217218        }
    218219
    219220        $key = 0;
    220         foreach ( $config_file as &$line ) {
     221        foreach ( $config_file as $line_num => $line ) {
    221222                if ( '$table_prefix  =' == substr( $line, 0, 16 ) ) {
    222                         $line = '$table_prefix  = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";
     223                        $config_file[ $line_num ] = '$table_prefix  = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";
    223224                        continue;
    224225                }
    225226
     
    234235                        case 'DB_USER'     :
    235236                        case 'DB_PASSWORD' :
    236237                        case 'DB_HOST'     :
    237                                 $line = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n";
     238                                $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n";
    238239                                break;
    239240                        case 'AUTH_KEY'         :
    240241                        case 'SECURE_AUTH_KEY'  :
     
    244245                        case 'SECURE_AUTH_SALT' :
    245246                        case 'LOGGED_IN_SALT'   :
    246247                        case 'NONCE_SALT'       :
    247                                 $line = "define('" . $constant . "'," . $padding . "'" . $secret_keys[$key++] . "');\r\n";
     248                                $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . $secret_keys[ $key++ ] . "');\r\n";
    248249                                break;
    249250                }
    250251        }
  • wp-includes/load.php

     
    105105        $php_version = phpversion();
    106106        if ( version_compare( $required_php_version, $php_version, '>' ) ) {
    107107                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 ) );
    109109        }
    110110
    111111        if ( ! extension_loaded( 'mysql' ) && ! file_exists( WP_CONTENT_DIR . '/db.php' ) ) {
    112112                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.' ) );
    114114        }
    115115}
    116116
     
    685685        require_once ABSPATH . WPINC . '/locale.php';
    686686
    687687        // General libraries
    688         require_once ABSPATH . WPINC . '/functions.php';
    689688        require_once ABSPATH . WPINC . '/plugin.php';
    690689
    691690        $locales = $locations = array();
  • wp-load.php

     
    5252        wp_check_php_mysql_versions();
    5353
    5454        // Die with an error message
     55        require_once( ABSPATH . WPINC . '/functions.php' );
    5556        $die  = __( "There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started." ) . '</p>';
    5657        $die .= '<p>' . __( "Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>." ) . '</p>';
    5758        $die .= '<p>' . __( "You can create a <code>wp-config.php</code> file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file." ) . '</p>';