Make WordPress Core

Changeset 21716


Ignore:
Timestamp:
09/04/2012 02:46:01 AM (12 years ago)
Author:
nacin
Message:

setup-config.php must be parseable by PHP4 so we can show a sane error message. wp-admin/index.php should ideally be as well. props SergeyBiryukov, see #21316.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

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

    r20715 r21716  
    22/**
    33 * Dashboard Administration Screen
     4 *
     5 * @internal This file should be parseable by PHP4.
    46 *
    57 * @package WordPress
     
    3335$help = '<p>' . __( 'Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the upper corner.' ) . '</p>';
    3436
    35 get_current_screen()->add_help_tab( array(
     37// Not using chaining here, so as to be parseable by PHP4.
     38$screen = get_current_screen();
     39
     40$screen->add_help_tab( array(
    3641    'id'      => 'overview',
    3742    'title'   => __( 'Overview' ),
     
    4449$help .= '<p>' . __('Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.') . '</p>';
    4550
    46 get_current_screen()->add_help_tab( array(
     51$screen->add_help_tab( array(
    4752    'id'      => 'help-navigation',
    4853    'title'   => __('Navigation'),
     
    5560$help .= '<p>' . __('<strong>Box Controls</strong> - Click the title bar of the box to expand or collapse it. In addition, some box have configurable content, and will show a &#8220;Configure&#8221; link in the title bar if you hover over it.') . '</p>';
    5661
    57 get_current_screen()->add_help_tab( array(
     62$screen->add_help_tab( array(
    5863    'id'      => 'help-layout',
    5964    'title'   => __('Layout'),
     
    7984    $help .= '<p>' . __('<strong>Welcome</strong> - Shows links for some of the most common tasks when setting up a new site.') . '</p>';
    8085
    81 get_current_screen()->add_help_tab( array(
     86$screen->add_help_tab( array(
    8287    'id'      => 'help-content',
    8388    'title'   => __('Content'),
     
    8792unset( $help );
    8893
    89 get_current_screen()->set_help_sidebar(
     94$screen->set_help_sidebar(
    9095    '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
    9196    '<p>' . __( '<a href="http://codex.wordpress.org/Dashboard_Screen" target="_blank">Documentation on Dashboard</a>' ) . '</p>' .
  • trunk/wp-admin/setup-config.php

    r21715 r21716  
    220220
    221221    $key = 0;
    222     foreach ( $config_file as &$line ) {
     222    // Not a PHP5-style by-reference foreach, as this file must be parseable by PHP4.
     223    foreach ( $config_file as $line_num => $line ) {
    223224        if ( '$table_prefix  =' == substr( $line, 0, 16 ) ) {
    224             $line = '$table_prefix  = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";
     225            $config_file[ $line_num ] = '$table_prefix  = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";
    225226            continue;
    226227        }
     
    237238            case 'DB_PASSWORD' :
    238239            case 'DB_HOST'     :
    239                 $line = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n";
     240                $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n";
    240241                break;
    241242            case 'AUTH_KEY'         :
     
    247248            case 'LOGGED_IN_SALT'   :
    248249            case 'NONCE_SALT'       :
    249                 $line = "define('" . $constant . "'," . $padding . "'" . $secret_keys[$key++] . "');\r\n";
     250                $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . $secret_keys[$key++] . "');\r\n";
    250251                break;
    251252        }
Note: See TracChangeset for help on using the changeset viewer.