WordPress.org

Make WordPress Core

Ticket #4685: wpinstall.04.diff

File wpinstall.04.diff, 5.7 KB (added by markjaquith, 7 years ago)

integrates fix for #4687

  • wp-settings.php

     
    142142require_once (ABSPATH . WPINC . '/l10n.php'); 
    143143 
    144144if ( !is_blog_installed() && (strpos($_SERVER['PHP_SELF'], 'install.php') === false && !defined('WP_INSTALLING')) ) { 
    145         if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) 
    146                 $link = 'install.php'; 
     145        if ( defined('WP_SITEURL') ) 
     146                $link = WP_SITEURL . '/wp-admin/install.php';  
     147        elseif (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) 
     148                $link = preg_replace('|/wp-admin/?.*?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; 
    147149        else 
    148                 $link = 'wp-admin/install.php'; 
    149  
    150         wp_die( sprintf( 'It doesn&#8217;t look like you&#8217;ve installed WP yet. Try running <a href="%s">install.php</a>.', $link ) ); 
     150                $link = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'wp-admin/install.php'; 
     151        require_once(ABSPATH . WPINC . '/kses.php'); 
     152        require_once(ABSPATH . WPINC . '/pluggable.php'); 
     153        wp_redirect($link); 
     154        die(); // have to die here ~ Mark 
    151155} 
    152156 
    153157require (ABSPATH . WPINC . '/formatting.php'); 
  • wp-admin/install.php

     
    3232 
    3333switch($step) { 
    3434        case 0: 
     35        case 1: // in case people are directly linking to this 
    3536?> 
    36 <p><?php printf(__('Welcome to WordPress installation. We&#8217;re now going to go through a few steps to get you up and running with the latest in personal publishing platforms. You may want to peruse the <a href="%s">ReadMe documentation</a> at your leisure.'), '../readme.html'); ?></p> 
    37 <h2 class="step"><a href="install.php?step=1"><?php _e('First Step &raquo;'); ?></a></h2> 
    38 <?php 
    39                 break; 
    40         case 1: 
    41 ?> 
    42 <h1><?php _e('First Step'); ?></h1> 
    43 <p><?php _e("Before we begin we need a little bit of information. Don't worry, you can always change these later."); ?></p> 
     37<h1>Welcome</h1> 
     38<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> 
     39<!--<h2 class="step"><a href="install.php?step=1"><?php _e('First Step &raquo;'); ?></a></h2>--> 
    4440 
     41<h1><?php _e('Information needed'); ?></h1> 
     42<p><?php _e("Please provide the following information.  Don't worry, you can always change these settings later."); ?></p> 
     43 
    4544<form id="setup" method="post" action="install.php?step=2"> 
    4645        <table width="100%"> 
    4746                <tr> 
     
    5453                </tr> 
    5554                <tr> 
    5655                        <th scope="row"  valign="top"> <?php __('Privacy:'); ?></th> 
    57                         <td><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('I would like my blog to appear in search engines like Google and Technorati.'); ?></label></td> 
     56                        <td><label><input type="checkbox" name="blog_public" value="1" checked="checked" /> <?php _e('Allow my blog to appear in search engines like Google and Technorati.'); ?></label></td> 
    5857                </tr> 
    5958        </table> 
    60         <p><em><?php _e('Double-check that email address before continuing.'); ?></em></p> 
    61         <h2 class="step"><input type="submit" name="Submit" value="<?php _e('Continue to Second Step &raquo;'); ?>" /></h2> 
     59        <p><em><?php _e('Double-check your email address before continuing.'); ?></em></p> 
     60        <h2 class="step"><input type="submit" name="Submit" value="<?php _e('Install WordPress &raquo;'); ?>" /></h2> 
    6261</form> 
    6362 
    6463<?php 
     
    7069                $public = (int) $_POST['blog_public']; 
    7170                // check e-mail address 
    7271                if (empty($admin_email)) { 
    73                         die(__("<strong>ERROR</strong>: please type your e-mail address")); 
     72                        // TODO: poka-yoke 
     73                        die(__("<strong>ERROR</strong>: you must provide an e-mail address")); 
    7474                } else if (!is_email($admin_email)) { 
    75                         die(__("<strong>ERROR</strong>: the e-mail address isn't correct")); 
     75                        // TODO: poka-yoke 
     76                        die(__('<strong>ERROR</strong>: that isn\'t a valid e-mail address.  E-mail addresses look like: <code>username@example.com</code>')); 
    7677                } 
    7778 
    78 ?> 
    79 <h1><?php _e('Second Step'); ?></h1> 
    80 <p><?php _e('Now we&#8217;re going to create the database tables and fill them with some default data.'); ?></p> 
    81  
    82  
    83 <?php 
    8479        $result = wp_install($weblog_title, 'admin', $admin_email, $public); 
    8580        extract($result, EXTR_SKIP); 
    8681?> 
    8782 
    88 <p><em><?php _e('Finished!'); ?></em></p> 
     83<h1><?php _e('Success!'); ?></h1> 
    8984 
    90 <p><?php printf(__('Now you can <a href="%1$s">log in</a> with the <strong>username</strong> "<code>admin</code>" and <strong>password</strong> "<code>%2$s</code>".'), '../wp-login.php', $password); ?></p> 
    91 <p><?php _e('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you. If you lose it, you will have to delete the tables from the database yourself, and re-install WordPress. So to review:'); ?></p> 
     85<p><?php printf(__('WordPress has been installed.  Now you can <a href="%1$s">log in</a> with the <strong>username</strong> "<code>admin</code>" and <strong>password</strong> "<code>%2$s</code>".'), '../wp-login.php', $password); ?></p> 
     86<p><?php _e('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.'); ?></p> 
    9287 
    9388<dl> 
    9489        <dt><?php _e('Username'); ?></dt> 
     
    9893        <dt><?php _e('Login address'); ?></dt> 
    9994                <dd><a href="../wp-login.php">wp-login.php</a></dd> 
    10095</dl> 
    101 <p><?php _e('Were you expecting more steps? Sorry to disappoint. All done! :)'); ?></p> 
     96<p><?php _e('Were you expecting more steps? Sorry to disappoint. :)'); ?></p> 
    10297 
    10398<?php 
    10499                break;