WordPress.org

Make WordPress Core

Ticket #5477: install-php.diff

File install-php.diff, 2.2 KB (added by JDTrower, 14 years ago)

Provides a "Go Back" link when a user fails to enter or enters an invalid email address at install while allowing the form fields to remember what had been entered.

  • install.php

     
    4848        <table width="100%">
    4949                <tr>
    5050                        <th width="33%"><?php _e('Blog title:'); ?></th>
    51                         <td><input name="weblog_title" type="text" id="weblog_title" size="25" /></td>
     51                        <td><input name="weblog_title" type="text" id="weblog_title" size="25" value="<?php print $_POST['eweblog_title']; ?>" /></td>
    5252                </tr>
    5353                <tr>
    5454                        <th><?php _e('Your e-mail:'); ?></th>
    55                         <td><input name="admin_email" type="text" id="admin_email" size="25" /></td>
     55                        <td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php print $_POST['eadmin_email']; ?>" /></td>
    5656                </tr>
    5757                <tr>
    5858                        <td>&nbsp;</td>
     
    7676                // check e-mail address
    7777                if (empty($admin_email)) {
    7878                        // TODO: poka-yoke
    79                         die(__("<strong>ERROR</strong>: you must provide an e-mail address"));
     79                        die(__('<strong>ERROR</strong>: you must provide an e-mail address<br /><form id="error" method="post" action="install.php"><input type="hidden" name="eweblog_title" value="' . $_POST['weblog_title'] . '" /><input type="hidden" name="eadmin_email" value="' . $_POST['admin_email'] . '" /><input type="submit" name="Submit" value="Go Back" /></form>'));
    8080                } else if (!is_email($admin_email)) {
    8181                        // TODO: poka-yoke
    82                         die(__('<strong>ERROR</strong>: that isn\'t a valid e-mail address.  E-mail addresses look like: <code>username@example.com</code>'));
     82                        die(__('<strong>ERROR</strong>: that isn\'t a valid e-mail address.  E-mail addresses look like: <code>username@example.com</code><br /><form id="error" method="post" action="install.php"><input type="hidden" name="eweblog_title" value="' . $_POST['weblog_title'] . '" /><input type="hidden" name="eadmin_email" value="' . $_POST['admin_email'] . '" /><input type="submit" name="Submit" value="Go Back" /></form>'));
    8383                }
    8484
    8585        $result = wp_install($weblog_title, 'admin', $admin_email, $public);
     
    108108
    109109<p id="footer"><?php _e('<a href="http://wordpress.org/">WordPress</a>, personal publishing platform.'); ?></p>
    110110</body>
    111 </html>
    112  No newline at end of file
     111</html>