WordPress.org

Make WordPress Core

Ticket #33909: 33909.4.diff

File 33909.4.diff, 17.7 KB (added by fgirardey, 4 years ago)

Fix tab indent

  • src/wp-admin/includes/schema.php

    diff --git src/wp-admin/includes/schema.php src/wp-admin/includes/schema.php
    index 4eb6bca..cf0828e 100644
    CREATE TABLE $wpdb->term_relationships ( 
    8585 KEY term_taxonomy_id (term_taxonomy_id)
    8686) $charset_collate;
    8787CREATE TABLE $wpdb->commentmeta (
    88   meta_id bigint(20) unsigned NOT NULL auto_increment,
    89   comment_id bigint(20) unsigned NOT NULL default '0',
    90   meta_key varchar(255) default NULL,
    91   meta_value longtext,
    92   PRIMARY KEY  (meta_id),
    93   KEY comment_id (comment_id),
    94   KEY meta_key (meta_key($max_index_length))
     88        meta_id bigint(20) unsigned NOT NULL auto_increment,
     89        comment_id bigint(20) unsigned NOT NULL default '0',
     90        meta_key varchar(255) default NULL,
     91        meta_value longtext,
     92        PRIMARY KEY  (meta_id),
     93        KEY comment_id (comment_id),
     94        KEY meta_key (meta_key($max_index_length))
    9595) $charset_collate;
    9696CREATE TABLE $wpdb->comments (
    97   comment_ID bigint(20) unsigned NOT NULL auto_increment,
    98   comment_post_ID bigint(20) unsigned NOT NULL default '0',
    99   comment_author tinytext NOT NULL,
    100   comment_author_email varchar(100) NOT NULL default '',
    101   comment_author_url varchar(200) NOT NULL default '',
    102   comment_author_IP varchar(100) NOT NULL default '',
    103   comment_date datetime NOT NULL default '0000-00-00 00:00:00',
    104   comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
    105   comment_content text NOT NULL,
    106   comment_karma int(11) NOT NULL default '0',
    107   comment_approved varchar(20) NOT NULL default '1',
    108   comment_agent varchar(255) NOT NULL default '',
    109   comment_type varchar(20) NOT NULL default '',
    110   comment_parent bigint(20) unsigned NOT NULL default '0',
    111   user_id bigint(20) unsigned NOT NULL default '0',
    112   PRIMARY KEY  (comment_ID),
    113   KEY comment_post_ID (comment_post_ID),
    114   KEY comment_approved_date_gmt (comment_approved,comment_date_gmt),
    115   KEY comment_date_gmt (comment_date_gmt),
    116   KEY comment_parent (comment_parent),
    117   KEY comment_author_email (comment_author_email(10))
     97        comment_ID bigint(20) unsigned NOT NULL auto_increment,
     98        comment_post_ID bigint(20) unsigned NOT NULL default '0',
     99        comment_author tinytext NOT NULL,
     100        comment_author_email varchar(100) NOT NULL default '',
     101        comment_author_url varchar(200) NOT NULL default '',
     102        comment_author_IP varchar(100) NOT NULL default '',
     103        comment_date datetime NOT NULL default '0000-00-00 00:00:00',
     104        comment_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
     105        comment_content text NOT NULL,
     106        comment_karma int(11) NOT NULL default '0',
     107        comment_approved varchar(20) NOT NULL default '1',
     108        comment_agent varchar(255) NOT NULL default '',
     109        comment_type varchar(20) NOT NULL default '',
     110        comment_parent bigint(20) unsigned NOT NULL default '0',
     111        user_id bigint(20) unsigned NOT NULL default '0',
     112        PRIMARY KEY  (comment_ID),
     113        KEY comment_post_ID (comment_post_ID),
     114        KEY comment_approved_date_gmt (comment_approved,comment_date_gmt),
     115        KEY comment_date_gmt (comment_date_gmt),
     116        KEY comment_parent (comment_parent),
     117        KEY comment_author_email (comment_author_email(10))
    118118) $charset_collate;
    119119CREATE TABLE $wpdb->links (
    120   link_id bigint(20) unsigned NOT NULL auto_increment,
    121   link_url varchar(255) NOT NULL default '',
    122   link_name varchar(255) NOT NULL default '',
    123   link_image varchar(255) NOT NULL default '',
    124   link_target varchar(25) NOT NULL default '',
    125   link_description varchar(255) NOT NULL default '',
    126   link_visible varchar(20) NOT NULL default 'Y',
    127   link_owner bigint(20) unsigned NOT NULL default '1',
    128   link_rating int(11) NOT NULL default '0',
    129   link_updated datetime NOT NULL default '0000-00-00 00:00:00',
    130   link_rel varchar(255) NOT NULL default '',
    131   link_notes mediumtext NOT NULL,
    132   link_rss varchar(255) NOT NULL default '',
    133   PRIMARY KEY  (link_id),
    134   KEY link_visible (link_visible)
     120        link_id bigint(20) unsigned NOT NULL auto_increment,
     121        link_url varchar(255) NOT NULL default '',
     122        link_name varchar(255) NOT NULL default '',
     123        link_image varchar(255) NOT NULL default '',
     124        link_target varchar(25) NOT NULL default '',
     125        link_description varchar(255) NOT NULL default '',
     126        link_visible varchar(20) NOT NULL default 'Y',
     127        link_owner bigint(20) unsigned NOT NULL default '1',
     128        link_rating int(11) NOT NULL default '0',
     129        link_updated datetime NOT NULL default '0000-00-00 00:00:00',
     130        link_rel varchar(255) NOT NULL default '',
     131        link_notes mediumtext NOT NULL,
     132        link_rss varchar(255) NOT NULL default '',
     133        PRIMARY KEY  (link_id),
     134        KEY link_visible (link_visible)
    135135) $charset_collate;
    136136CREATE TABLE $wpdb->options (
    137   option_id bigint(20) unsigned NOT NULL auto_increment,
    138   option_name varchar(191) NOT NULL default '',
    139   option_value longtext NOT NULL,
    140   autoload varchar(20) NOT NULL default 'yes',
    141   PRIMARY KEY  (option_id),
    142   UNIQUE KEY option_name (option_name)
     137        option_id bigint(20) unsigned NOT NULL auto_increment,
     138        option_name varchar(191) NOT NULL default '',
     139        option_value longtext NOT NULL,
     140        autoload varchar(20) NOT NULL default 'yes',
     141        PRIMARY KEY  (option_id),
     142        UNIQUE KEY option_name (option_name)
    143143) $charset_collate;
    144144CREATE TABLE $wpdb->postmeta (
    145   meta_id bigint(20) unsigned NOT NULL auto_increment,
    146   post_id bigint(20) unsigned NOT NULL default '0',
    147   meta_key varchar(255) default NULL,
    148   meta_value longtext,
    149   PRIMARY KEY  (meta_id),
    150   KEY post_id (post_id),
    151   KEY meta_key (meta_key($max_index_length))
     145        meta_id bigint(20) unsigned NOT NULL auto_increment,
     146        post_id bigint(20) unsigned NOT NULL default '0',
     147        meta_key varchar(255) default NULL,
     148        meta_value longtext,
     149        PRIMARY KEY  (meta_id),
     150        KEY post_id (post_id),
     151        KEY meta_key (meta_key($max_index_length))
    152152) $charset_collate;
    153153CREATE TABLE $wpdb->posts (
    154   ID bigint(20) unsigned NOT NULL auto_increment,
    155   post_author bigint(20) unsigned NOT NULL default '0',
    156   post_date datetime NOT NULL default '0000-00-00 00:00:00',
    157   post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
    158   post_content longtext NOT NULL,
    159   post_title text NOT NULL,
    160   post_excerpt text NOT NULL,
    161   post_status varchar(20) NOT NULL default 'publish',
    162   comment_status varchar(20) NOT NULL default 'open',
    163   ping_status varchar(20) NOT NULL default 'open',
    164   post_password varchar(20) NOT NULL default '',
    165   post_name varchar(200) NOT NULL default '',
    166   to_ping text NOT NULL,
    167   pinged text NOT NULL,
    168   post_modified datetime NOT NULL default '0000-00-00 00:00:00',
    169   post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00',
    170   post_content_filtered longtext NOT NULL,
    171   post_parent bigint(20) unsigned NOT NULL default '0',
    172   guid varchar(255) NOT NULL default '',
    173   menu_order int(11) NOT NULL default '0',
    174   post_type varchar(20) NOT NULL default 'post',
    175   post_mime_type varchar(100) NOT NULL default '',
    176   comment_count bigint(20) NOT NULL default '0',
    177   PRIMARY KEY  (ID),
    178   KEY post_name (post_name($max_index_length)),
    179   KEY type_status_date (post_type,post_status,post_date,ID),
    180   KEY post_parent (post_parent),
    181   KEY post_author (post_author)
     154        ID bigint(20) unsigned NOT NULL auto_increment,
     155        post_author bigint(20) unsigned NOT NULL default '0',
     156        post_date datetime NOT NULL default '0000-00-00 00:00:00',
     157        post_date_gmt datetime NOT NULL default '0000-00-00 00:00:00',
     158        post_content longtext NOT NULL,
     159        post_title text NOT NULL,
     160        post_excerpt text NOT NULL,
     161        post_status varchar(20) NOT NULL default 'publish',
     162        comment_status varchar(20) NOT NULL default 'open',
     163        ping_status varchar(20) NOT NULL default 'open',
     164        post_password varchar(20) NOT NULL default '',
     165        post_name varchar(200) NOT NULL default '',
     166        to_ping text NOT NULL,
     167        pinged text NOT NULL,
     168        post_modified datetime NOT NULL default '0000-00-00 00:00:00',
     169        post_modified_gmt datetime NOT NULL default '0000-00-00 00:00:00',
     170        post_content_filtered longtext NOT NULL,
     171        post_parent bigint(20) unsigned NOT NULL default '0',
     172        guid varchar(255) NOT NULL default '',
     173        menu_order int(11) NOT NULL default '0',
     174        post_type varchar(20) NOT NULL default 'post',
     175        post_mime_type varchar(100) NOT NULL default '',
     176        comment_count bigint(20) NOT NULL default '0',
     177        PRIMARY KEY  (ID),
     178        KEY post_name (post_name($max_index_length)),
     179        KEY type_status_date (post_type,post_status,post_date,ID),
     180        KEY post_parent (post_parent),
     181        KEY post_author (post_author)
    182182) $charset_collate;\n";
    183183
    184184        // Single site users table. The multisite flavor of the users table is handled below.
    185185        $users_single_table = "CREATE TABLE $wpdb->users (
    186   ID bigint(20) unsigned NOT NULL auto_increment,
    187   user_login varchar(60) NOT NULL default '',
    188   user_pass varchar(64) NOT NULL default '',
    189   user_nicename varchar(50) NOT NULL default '',
    190   user_email varchar(100) NOT NULL default '',
    191   user_url varchar(100) NOT NULL default '',
    192   user_registered datetime NOT NULL default '0000-00-00 00:00:00',
    193   user_activation_key varchar(60) NOT NULL default '',
    194   user_status int(11) NOT NULL default '0',
    195   display_name varchar(250) NOT NULL default '',
    196   PRIMARY KEY  (ID),
    197   KEY user_login_key (user_login),
    198   KEY user_nicename (user_nicename)
     186        ID bigint(20) unsigned NOT NULL auto_increment,
     187        user_login varchar(60) NOT NULL default '',
     188        user_pass varchar(64) NOT NULL default '',
     189        user_nicename varchar(50) NOT NULL default '',
     190        user_email varchar(100) NOT NULL default '',
     191        user_url varchar(100) NOT NULL default '',
     192        user_registered datetime NOT NULL default '0000-00-00 00:00:00',
     193        user_activation_key varchar(60) NOT NULL default '',
     194        user_status int(11) NOT NULL default '0',
     195        display_name varchar(250) NOT NULL default '',
     196        PRIMARY KEY  (ID),
     197        KEY user_login_key (user_login),
     198        KEY user_nicename (user_nicename)
    199199) $charset_collate;\n";
    200200
    201201        // Multisite users table
    202202        $users_multi_table = "CREATE TABLE $wpdb->users (
    203   ID bigint(20) unsigned NOT NULL auto_increment,
    204   user_login varchar(60) NOT NULL default '',
    205   user_pass varchar(64) NOT NULL default '',
    206   user_nicename varchar(50) NOT NULL default '',
    207   user_email varchar(100) NOT NULL default '',
    208   user_url varchar(100) NOT NULL default '',
    209   user_registered datetime NOT NULL default '0000-00-00 00:00:00',
    210   user_activation_key varchar(60) NOT NULL default '',
    211   user_status int(11) NOT NULL default '0',
    212   display_name varchar(250) NOT NULL default '',
    213   spam tinyint(2) NOT NULL default '0',
    214   deleted tinyint(2) NOT NULL default '0',
    215   PRIMARY KEY  (ID),
    216   KEY user_login_key (user_login),
    217   KEY user_nicename (user_nicename)
     203        ID bigint(20) unsigned NOT NULL auto_increment,
     204        user_login varchar(60) NOT NULL default '',
     205        user_pass varchar(64) NOT NULL default '',
     206        user_nicename varchar(50) NOT NULL default '',
     207        user_email varchar(100) NOT NULL default '',
     208        user_url varchar(100) NOT NULL default '',
     209        user_registered datetime NOT NULL default '0000-00-00 00:00:00',
     210        user_activation_key varchar(60) NOT NULL default '',
     211        user_status int(11) NOT NULL default '0',
     212        display_name varchar(250) NOT NULL default '',
     213        spam tinyint(2) NOT NULL default '0',
     214        deleted tinyint(2) NOT NULL default '0',
     215        PRIMARY KEY  (ID),
     216        KEY user_login_key (user_login),
     217        KEY user_nicename (user_nicename)
    218218) $charset_collate;\n";
    219219
    220220        // Usermeta.
    221221        $usermeta_table = "CREATE TABLE $wpdb->usermeta (
    222   umeta_id bigint(20) unsigned NOT NULL auto_increment,
    223   user_id bigint(20) unsigned NOT NULL default '0',
    224   meta_key varchar(255) default NULL,
    225   meta_value longtext,
    226   PRIMARY KEY  (umeta_id),
    227   KEY user_id (user_id),
    228   KEY meta_key (meta_key($max_index_length))
     222        umeta_id bigint(20) unsigned NOT NULL auto_increment,
     223        user_id bigint(20) unsigned NOT NULL default '0',
     224        meta_key varchar(255) default NULL,
     225        meta_value longtext,
     226        PRIMARY KEY  (umeta_id),
     227        KEY user_id (user_id),
     228        KEY meta_key (meta_key($max_index_length))
    229229) $charset_collate;\n";
    230230
    231231        // Global tables
    CREATE TABLE $wpdb->posts ( 
    236236
    237237        // Multisite global tables.
    238238        $ms_global_tables = "CREATE TABLE $wpdb->blogs (
    239   blog_id bigint(20) NOT NULL auto_increment,
    240   site_id bigint(20) NOT NULL default '0',
    241   domain varchar(200) NOT NULL default '',
    242   path varchar(100) NOT NULL default '',
    243   registered datetime NOT NULL default '0000-00-00 00:00:00',
    244   last_updated datetime NOT NULL default '0000-00-00 00:00:00',
    245   public tinyint(2) NOT NULL default '1',
    246   archived tinyint(2) NOT NULL default '0',
    247   mature tinyint(2) NOT NULL default '0',
    248   spam tinyint(2) NOT NULL default '0',
    249   deleted tinyint(2) NOT NULL default '0',
    250   lang_id int(11) NOT NULL default '0',
    251   PRIMARY KEY  (blog_id),
    252   KEY domain (domain(50),path(5)),
    253   KEY lang_id (lang_id)
     239        blog_id bigint(20) NOT NULL auto_increment,
     240        site_id bigint(20) NOT NULL default '0',
     241        domain varchar(200) NOT NULL default '',
     242        path varchar(100) NOT NULL default '',
     243        registered datetime NOT NULL default '0000-00-00 00:00:00',
     244        last_updated datetime NOT NULL default '0000-00-00 00:00:00',
     245        public tinyint(2) NOT NULL default '1',
     246        archived tinyint(2) NOT NULL default '0',
     247        mature tinyint(2) NOT NULL default '0',
     248        spam tinyint(2) NOT NULL default '0',
     249        deleted tinyint(2) NOT NULL default '0',
     250        lang_id int(11) NOT NULL default '0',
     251        PRIMARY KEY  (blog_id),
     252        KEY domain (domain(50),path(5)),
     253        KEY lang_id (lang_id)
    254254) $charset_collate;
    255255CREATE TABLE $wpdb->blog_versions (
    256   blog_id bigint(20) NOT NULL default '0',
    257   db_version varchar(20) NOT NULL default '',
    258   last_updated datetime NOT NULL default '0000-00-00 00:00:00',
    259   PRIMARY KEY  (blog_id),
    260   KEY db_version (db_version)
     256        blog_id bigint(20) NOT NULL default '0',
     257        db_version varchar(20) NOT NULL default '',
     258        last_updated datetime NOT NULL default '0000-00-00 00:00:00',
     259        PRIMARY KEY  (blog_id),
     260        KEY db_version (db_version)
    261261) $charset_collate;
    262262CREATE TABLE $wpdb->registration_log (
    263   ID bigint(20) NOT NULL auto_increment,
    264   email varchar(255) NOT NULL default '',
    265   IP varchar(30) NOT NULL default '',
    266   blog_id bigint(20) NOT NULL default '0',
    267   date_registered datetime NOT NULL default '0000-00-00 00:00:00',
    268   PRIMARY KEY  (ID),
    269   KEY IP (IP)
     263        ID bigint(20) NOT NULL auto_increment,
     264        email varchar(255) NOT NULL default '',
     265        IP varchar(30) NOT NULL default '',
     266        blog_id bigint(20) NOT NULL default '0',
     267        date_registered datetime NOT NULL default '0000-00-00 00:00:00',
     268        PRIMARY KEY  (ID),
     269        KEY IP (IP)
    270270) $charset_collate;
    271271CREATE TABLE $wpdb->site (
    272   id bigint(20) NOT NULL auto_increment,
    273   domain varchar(200) NOT NULL default '',
    274   path varchar(100) NOT NULL default '',
    275   PRIMARY KEY  (id),
    276   KEY domain (domain(140),path(51))
     272        id bigint(20) NOT NULL auto_increment,
     273        domain varchar(200) NOT NULL default '',
     274        path varchar(100) NOT NULL default '',
     275        PRIMARY KEY  (id),
     276        KEY domain (domain(140),path(51))
    277277) $charset_collate;
    278278CREATE TABLE $wpdb->sitemeta (
    279   meta_id bigint(20) NOT NULL auto_increment,
    280   site_id bigint(20) NOT NULL default '0',
    281   meta_key varchar(255) default NULL,
    282   meta_value longtext,
    283   PRIMARY KEY  (meta_id),
    284   KEY meta_key (meta_key($max_index_length)),
    285   KEY site_id (site_id)
     279        meta_id bigint(20) NOT NULL auto_increment,
     280        site_id bigint(20) NOT NULL default '0',
     281        meta_key varchar(255) default NULL,
     282        meta_value longtext,
     283        PRIMARY KEY  (meta_id),
     284        KEY meta_key (meta_key($max_index_length)),
     285        KEY site_id (site_id)
    286286) $charset_collate;
    287287CREATE TABLE $wpdb->signups (
    288   signup_id bigint(20) NOT NULL auto_increment,
    289   domain varchar(200) NOT NULL default '',
    290   path varchar(100) NOT NULL default '',
    291   title longtext NOT NULL,
    292   user_login varchar(60) NOT NULL default '',
    293   user_email varchar(100) NOT NULL default '',
    294   registered datetime NOT NULL default '0000-00-00 00:00:00',
    295   activated datetime NOT NULL default '0000-00-00 00:00:00',
    296   active tinyint(1) NOT NULL default '0',
    297   activation_key varchar(50) NOT NULL default '',
    298   meta longtext,
    299   PRIMARY KEY  (signup_id),
    300   KEY activation_key (activation_key),
    301   KEY user_email (user_email),
    302   KEY user_login_email (user_login,user_email),
    303   KEY domain_path (domain(140),path(51))
     288        signup_id bigint(20) NOT NULL auto_increment,
     289        domain varchar(200) NOT NULL default '',
     290        path varchar(100) NOT NULL default '',
     291        title longtext NOT NULL,
     292        user_login varchar(60) NOT NULL default '',
     293        user_email varchar(100) NOT NULL default '',
     294        registered datetime NOT NULL default '0000-00-00 00:00:00',
     295        activated datetime NOT NULL default '0000-00-00 00:00:00',
     296        active tinyint(1) NOT NULL default '0',
     297        activation_key varchar(50) NOT NULL default '',
     298        meta longtext,
     299        PRIMARY KEY  (signup_id),
     300        KEY activation_key (activation_key),
     301        KEY user_email (user_email),
     302        KEY user_login_email (user_login,user_email),
     303        KEY domain_path (domain(140),path(51))
    304304) $charset_collate;";
    305305
    306306        switch ( $scope ) {
    $wp_queries = wp_get_db_schema( 'all' ); 
    344344function populate_options() {
    345345        global $wpdb, $wp_db_version, $wp_current_db_version;
    346346
    347         $guessurl = wp_guess_url();
     347        $guessurl = $homeurl = wp_guess_url();
     348        if ( defined( 'WP_HOME' ) && ! empty( WP_HOME ) ) { // wp_guess_url() checked WP_SITEURL constant.
     349                $homeurl = rtrim( WP_HOME, '/' );
     350        }
    348351        /**
    349352         * Fires before creating WordPress options and populating their default values.
    350353         *
    function populate_options() { 
    368371        $timezone_string = '';
    369372        $gmt_offset = 0;
    370373        /* translators: default GMT offset or timezone string. Must be either a valid offset (-12 to 14)
    371           or a valid timezone string (America/New_York). See http://us3.php.net/manual/en/timezones.php
    372           for all timezone strings supported by PHP.
     374                or a valid timezone string (America/New_York). See http://us3.php.net/manual/en/timezones.php
     375                for all timezone strings supported by PHP.
    373376        */
    374377        $offset_or_tz = _x( '0', 'default GMT offset or timezone string' );
    375378        if ( is_numeric( $offset_or_tz ) )
    function populate_options() { 
    379382
    380383        $options = array(
    381384        'siteurl' => $guessurl,
    382         'home' => $guessurl,
     385        'home' => $homeurl,
    383386        'blogname' => __('My Site'),
    384387        /* translators: blog tagline */
    385388        'blogdescription' => __('Just another WordPress site'),