WordPress.org

Make WordPress Core

Changeset 11301


Ignore:
Timestamp:
05/12/09 16:47:49 (5 years ago)
Author:
ryan
Message:

Use absolute paths for includes. Props hakre. fixes #9750

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/install.php

    r11204 r11301  
    1515define('WP_INSTALLING', true); 
    1616 
     17/** 
     18 * This constant is used to include wp-load.php 
     19 */ 
     20define('ABSPATH', dirname(dirname(__FILE__)).'/'); 
     21 
    1722/** Load WordPress Bootstrap */ 
    18 require_once('../wp-load.php'); 
     23require_once(ABSPATH . 'wp-load.php'); 
    1924 
    2025/** Load WordPress Administration Upgrade API */ 
    21 require_once('./includes/upgrade.php'); 
     26require_once(dirname(__FILE__) . '/includes/upgrade.php'); 
    2227 
    2328if (isset($_GET['step'])) 
  • trunk/wp-admin/setup-config.php

    r10698 r11301  
    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 
     
    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) { 
     
    180180    } 
    181181    fclose($handle); 
    182     chmod('../wp-config.php', 0666); 
     182    chmod(ABSPATH . 'wp-config.php', 0666); 
    183183 
    184184    display_header(); 
Note: See TracChangeset for help on using the changeset viewer.