WordPress.org

Make WordPress Core

Ticket #10011: 10011.theme.patch

File 10011.theme.patch, 672 bytes (added by bforchhammer, 6 years ago)

Hm, theme_basename() doesn't look right to me.. $theme_dir is set up but not actually used in the preg_replace() call...

  • wp-includes/theme.php

     
    11531153        $file = preg_replace('|/+|','/', $file); // remove any duplicate slash 
    11541154        $theme_dir = str_replace('\\','/', get_theme_root()); // sanitize for Win32 installs 
    11551155        $theme_dir = preg_replace('|/+|','/', $theme_dir); // remove any duplicate slash 
    1156         $file = preg_replace('|^.*/themes/.*?/|','',$file); // get relative path from theme dir 
     1156        $file = preg_replace('|^'. preg_quote($theme_dir, '#') .'/|','',$file); // get relative path from theme dir 
    11571157        return $file; 
    11581158} 
    11591159