Make WordPress Core

Changeset 18993


Ignore:
Timestamp:
10/18/2011 07:37:07 PM (13 years ago)
Author:
nacin
Message:

Explicitly globalize $table_prefix in wp-settings.php in case WordPress isn't loaded in global scope. Use $_SERVERPHP_SELF?, not $PHP_SELF. We need to keep $PHP_SELF for backwards compatibility reasons (many, many plugins rely on it). props mrtorrent, fixes #17749.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/vars.php

    r18982 r18993  
    1717    // wp-admin pages are checked more carefully
    1818    if ( is_network_admin() )
    19         preg_match('#/wp-admin/network/?(.*?)$#i', $PHP_SELF, $self_matches);
     19        preg_match('#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches);
    2020    elseif ( is_user_admin() )
    21         preg_match('#/wp-admin/user/?(.*?)$#i', $PHP_SELF, $self_matches);
     21        preg_match('#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches);
    2222    else
    23         preg_match('#/wp-admin/?(.*?)$#i', $PHP_SELF, $self_matches);
     23        preg_match('#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches);
    2424    $pagenow = $self_matches[1];
    2525    $pagenow = trim($pagenow, '/');
     
    3434    }
    3535} else {
    36     if ( preg_match('#([^/]+\.php)([?/].*?)?$#i', $PHP_SELF, $self_matches) )
     36    if ( preg_match('#([^/]+\.php)([?/].*?)?$#i', $_SERVER['PHP_SELF'], $self_matches) )
    3737        $pagenow = strtolower($self_matches[1]);
    3838    else
  • trunk/wp-settings.php

    r18756 r18993  
    7676
    7777// Set the database table prefix and the format specifiers for database table columns.
     78$GLOBALS['table_prefix'] = $table_prefix;
    7879wp_set_wpdb_vars();
    7980
Note: See TracChangeset for help on using the changeset viewer.