Make WordPress Core

Ticket #9750: 9750.patch

File 9750.patch, 2.4 KB (added by hakre, 17 years ago)

first patch.

  • wp-admin/setup-config.php

     
    2626define('WP_CONTENT_DIR', ABSPATH . 'wp-content');
    2727/**#@-*/
    2828
    29 require_once('../wp-includes/compat.php');
    30 require_once('../wp-includes/functions.php');
    31 require_once('../wp-includes/classes.php');
     29require_once(ABSPATH . WPINC . '/compat.php');
     30require_once(ABSPATH . WPINC . '/functions.php');
     31require_once(ABSPATH . WPINC . '/classes.php');
    3232
    33 if (!file_exists('../wp-config-sample.php'))
     33if (!file_exists(ABSPATH . 'wp-config-sample.php'))
    3434        wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.');
    3535
    36 $configFile = file('../wp-config-sample.php');
     36$configFile = file(ABSPATH . 'wp-config-sample.php');
    3737
    38 if ( !is_writable('../'))
     38if ( !is_writable(ABSPATH))
    3939        wp_die("Sorry, I can't write to the directory. You'll have to either change the permissions on your WordPress directory or create your wp-config.php manually.");
    4040
    4141// Check if wp-config.php has been created
    42 if (file_exists('../wp-config.php'))
     42if (file_exists(ABSPATH . 'wp-config.php'))
    4343        wp_die("<p>The file 'wp-config.php' already exists. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
    4444
    4545// Check if wp-config.php exists above the root directory but is not part of another install
    46 if (file_exists('../../wp-config.php') && ! file_exists('../../wp-settings.php'))
     46if (file_exists(ABSPATH . '../wp-config.php') && ! file_exists(ABSPATH . '../wp-settings.php'))
    4747        wp_die("<p>The file 'wp-config.php' already exists one level above your WordPress installation. If you need to reset any of the configuration items in this file, please delete it first. You may try <a href='install.php'>installing now</a>.</p>");
    4848
    4949if (isset($_GET['step']))
     
    155155        if ( !empty($wpdb->error) )
    156156                wp_die($wpdb->error->get_error_message());
    157157
    158         $handle = fopen('../wp-config.php', 'w');
     158        $handle = fopen(ABSPATH . 'wp-config.php', 'w');
    159159
    160160        foreach ($configFile as $line_num => $line) {
    161161                switch (substr($line,0,16)) {
     
    179179                }
    180180        }
    181181        fclose($handle);
    182         chmod('../wp-config.php', 0666);
     182        chmod(ABSPATH . 'wp-config.php', 0666);
    183183
    184184        display_header();
    185185?>