diff --git src/wp-admin/includes/upgrade.php src/wp-admin/includes/upgrade.php
index 558b88e..e846bce 100644
|
|
function upgrade_network() { |
1363 | 1363 | update_site_option( 'illegal_names', $illegal_names ); |
1364 | 1364 | } |
1365 | 1365 | } |
| 1366 | |
| 1367 | // 4.0.0 |
| 1368 | if ( $wp_current_db_version < 30000 ) { |
| 1369 | $wpdb->update( $wpdb->blogs, array( 'path' => '/' ), array( 'path' => '' ) ); |
| 1370 | } |
| 1371 | |
1366 | 1372 | } |
1367 | 1373 | |
1368 | 1374 | // The functions we use to actually do stuff |
diff --git src/wp-includes/ms-blogs.php src/wp-includes/ms-blogs.php
index 16a4918..46e36e8 100644
|
|
function update_blog_details( $blog_id, $details = array() ) { |
290 | 290 | $details = array_merge($current_details, $details); |
291 | 291 | $details['last_updated'] = current_time('mysql', true); |
292 | 292 | |
| 293 | // Ensure that the path always has a slash |
| 294 | if ( isset( $details['path'] ) ) { |
| 295 | $details['path'] = trailingslashit( $details['path'] ); |
| 296 | } |
| 297 | |
293 | 298 | $update_details = array(); |
294 | 299 | $fields = array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id'); |
295 | 300 | foreach ( array_intersect( array_keys( $details ), $fields ) as $field ) |
diff --git src/wp-includes/ms-load.php src/wp-includes/ms-load.php
index 02224bd..95db548 100644
|
|
function get_site_by_path( $domain, $path, $segments = null ) { |
374 | 374 | $site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $domains[0], $paths[0] ) ); |
375 | 375 | } |
376 | 376 | |
| 377 | // One last attempt, in case the path column is empty for the site. Addresses #28273 |
| 378 | if ( ! $site ) { |
| 379 | $site = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = ''", $domains[0] ) ); |
| 380 | } |
| 381 | |
377 | 382 | if ( $site ) { |
378 | 383 | // @todo get_blog_details() |
379 | 384 | return $site; |