WordPress.org

Make WordPress Core

Changeset 6137


Ignore:
Timestamp:
09/19/07 04:27:56 (7 years ago)
Author:
ryan
Message:

Fix includes for setup-config so that wp_die is defined. Props DD32. fixes #4997

Location:
trunk
Files:
3 edited

Legend:

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

    r6122 r6137  
    22define('WP_INSTALLING', true); 
    33if (!file_exists('../wp-config.php')) { 
     4  require_once('../wp-includes/compat.php'); 
    45  require_once('../wp-includes/functions.php'); 
    56  wp_die("There doesn't seem to be a <code>wp-config.php</code> file. I need this before we can get started. Need more help? <a href='http://codex.wordpress.org/Editing_wp-config.php'>We got it</a>. You can <a href='setup-config.php'>create a <code>wp-config.php</code> file through a web interface</a>, but this doesn't work for all server setups. The safest way is to manually create the file.", "WordPress &rsaquo; Error"); 
  • trunk/wp-admin/setup-config.php

    r5001 r6137  
    22define('WP_INSTALLING', true); 
    33 
     4require_once('../wp-includes/compat.php'); 
     5require_once('../wp-includes/functions.php'); 
     6 
    47if (!file_exists('../wp-config-sample.php')) 
    5     die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.'); 
     8    wp_die('Sorry, I need a wp-config-sample.php file to work from. Please re-upload this file from your WordPress installation.'); 
    69 
    710$configFile = file('../wp-config-sample.php'); 
    811 
    9 if (!is_writable('../')) 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."); 
     12if ( !is_writable('../'))  
     13    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."); 
    1014 
     15// Check if wp-config.php has been created 
     16if (file_exists('../wp-config.php')) 
     17    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>"); 
    1118 
    1219if (isset($_GET['step'])) 
     
    1421else 
    1522    $step = 0; 
    16 header( 'Content-Type: text/html; charset=utf-8' ); 
     23 
     24function display_header(){ 
     25    header( 'Content-Type: text/html; charset=utf-8' ); 
    1726?> 
    1827<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    7786<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1> 
    7887<?php 
    79 // Check if wp-config.php has been created 
    80 if (file_exists('../wp-config.php')) 
    81     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></body></html>"); 
     88}//end function display_header(); 
    8289 
    8390switch($step) { 
    8491    case 0: 
     92        display_header(); 
    8593?> 
    8694 
     
    99107 
    100108    case 1: 
     109        display_header(); 
    101110    ?> 
    102111</p> 
     
    178187    fclose($handle); 
    179188    chmod('../wp-config.php', 0666); 
     189     
     190    display_header(); 
    180191?> 
    181192<p>All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to <a href="install.php">run the install!</a></p> 
  • trunk/wp-includes/functions.php

    r6110 r6137  
    12421242 
    12431243    if ( !function_exists('did_action') || !did_action('admin_head') ) : 
    1244     status_header(500); 
    1245     nocache_headers(); 
    1246     header('Content-Type: text/html; charset=utf-8'); 
     1244    if( !headers_sent() ){ 
     1245        status_header(500); 
     1246        nocache_headers(); 
     1247        header('Content-Type: text/html; charset=utf-8'); 
     1248    } 
    12471249 
    12481250    if ( empty($title) ){ 
Note: See TracChangeset for help on using the changeset viewer.