WordPress.org

Make WordPress Core

Ticket #19655: basename-patch.diff

File basename-patch.diff, 622 bytes (added by BaylorRae, 2 years ago)

The SVN diff

  • wp-admin/includes/theme.php

     
    181181        $page_templates = array(); 
    182182 
    183183        if ( is_array( $templates ) ) { 
    184                 $base = array( trailingslashit(get_template_directory()), trailingslashit(get_stylesheet_directory()) ); 
    185184 
    186185                foreach ( $templates as $template ) { 
    187                         $basename = str_replace($base, '', $template); 
     186                        $basename = basename($template); 
    188187 
    189188                        // don't allow template files in subdirectories 
    190189                        if ( false !== strpos($basename, '/') )