Ticket #5495: install.diff

File install.diff, 1.9 KB (added by Potter_System, 4 years ago)

Updated to detect if MySQL fails

  • wp-admin/install.php

     
    1313        $step = $_GET['step']; 
    1414else 
    1515        $step = 0; 
     16function display_header(){ 
    1617header( 'Content-Type: text/html; charset=utf-8' ); 
    1718?> 
    1819<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    2425</head> 
    2526<body> 
    2627<h1 id="logo"><img alt="WordPress" src="images/wordpress-logo.png" /></h1> 
     28 
    2729<?php 
     30}//end function display_header(); 
     31 
    2832// Let's check to make sure WP isn't already installed. 
    29 if ( is_blog_installed() ) die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>'); 
     33if ( is_blog_installed() ) {display_header(); die('<h1>'.__('Already Installed').'</h1><p>'.__('You appear to have already installed WordPress. To reinstall please clear your old database tables first.').'</p></body></html>');} 
    3034 
    3135switch($step) { 
    3236        case 0: 
    3337        case 1: // in case people are directly linking to this 
     38          display_header(); 
    3439?> 
    3540<h1><?php _e('Welcome'); ?></h1> 
    3641<p><?php printf(__('Welcome to the famous five minute WordPress installation process! You may want to browse the <a href="%s">ReadMe documentation</a> at your leisure.  Otherwise, just fill in the information below and you\'ll be on your way to using the most extendable and powerful personal publishing platform in the world.'), '../readme.html'); ?></p> 
     
    6166<?php 
    6267                break; 
    6368        case 2: 
     69          if ( !empty($wpdb->error) ) 
     70                wp_die($wpdb->error->get_error_message()); 
     71        display_header();        
    6472                // Fill in the data we gathered 
    6573                $weblog_title = stripslashes($_POST['weblog_title']); 
    6674                $admin_email = stripslashes($_POST['admin_email']);