WordPress.org

Make WordPress Core

Ticket #23865: 23865.2.diff

File 23865.2.diff, 657 bytes (added by simonwheatley, 6 years ago)

Use sanitize_title and manually add prefixing and trailing slash for subdir site path

  • wp-includes/ms-blogs.php

     
    274274        foreach ( array_intersect( array_keys( $details ), $fields ) as $field )
    275275                $update_details[$field] = $details[$field];
    276276
     277        // Ensure that path has a trailing slash and prefixing slash
     278        $update_details[ 'path' ] = sanitize_title( $update_details[ 'path' ] );
     279        $update_details[ 'path' ] = "/{$update_details[ 'path' ]}/";
     280
    277281        $result = $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );
    278282
    279283        if ( false === $result )