WordPress.org

Make WordPress Core

Ticket #18117: 18117.3.diff

File 18117.3.diff, 930 bytes (added by jeremyfelt, 7 years ago)
  • src/wp-includes/ms-blogs.php

     
    296296
    297297        $update_details = array();
    298298        $fields = array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id');
    299         foreach ( array_intersect( array_keys( $details ), $fields ) as $field )
    300                 $update_details[$field] = $details[$field];
     299        foreach ( array_intersect( array_keys( $details ), $fields ) as $field ) {
     300                if ( 'path' === $field ) {
     301                        $details[ $field ] = array_filter( explode( '/', $details[ $field ] ) );
     302                        $details[ $field ] = '/' . implode( '/', $details[ $field ] ) . '/';
     303                }
     304
     305                $update_details[ $field ] = $details[ $field ];
     306        }
    301307
    302308        $result = $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );
    303309