Make WordPress Core

Ticket #23865: 23865.diff

File 23865.diff, 690 bytes (added by simonwheatley, 12 years ago)

Ensures trailing and prefixing slash on path

  • wp-includes/ms-blogs.php

     
    300300        foreach ( array_intersect( array_keys( $details ), $fields ) as $field )
    301301                $update_details[$field] = $details[$field];
    302302
     303        // Ensure that path has a trailing slash and prefixing slash
     304        $update_details[ 'path' ] = trailingslashit( $update_details[ 'path' ] );
     305        if ( '/' != substr( 0, 1 ) )
     306                $update_details[ 'path' ] = '/' . $update_details[ 'path' ];
     307
    303308        $result = $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );
    304309
    305310        if ( false === $result )