WordPress.org

Make WordPress Core

Changeset 13563


Ignore:
Timestamp:
03/02/2010 10:55:02 PM (11 years ago)
Author:
ryan
Message:

allow empty table prefix on my-sites.php, see #12459

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r13562 r13563  
    5050
    5151    $blogs = $match = array();
     52    $prefix_length = strlen($wpdb->base_prefix);
    5253    foreach ( (array) $user as $key => $value ) {
    53         if ( false !== strpos( $key, '_capabilities') && ( strlen( $wpdb->base_prefix ) == 0 || 0 === strpos( $key, $wpdb->base_prefix ) ) && preg_match( '/' . $wpdb->base_prefix . '((\d+)_)?capabilities/', $key, $match ) ) {
     54        if ( $prefix_length && substr($key, 0, $prefix_length) != $wpdb->base_prefix )
     55            continue;
     56        if ( substr($key, -12, 12) != 'capabilities' )
     57            continue;
     58        if ( preg_match( '/^' . $wpdb->base_prefix . '((\d+)_)?capabilities$/', $key, $match ) ) {
    5459            if ( count( $match ) > 2 )
    5560                $blog_id = $match[ 2 ];
Note: See TracChangeset for help on using the changeset viewer.