regex rather than two str_replaces, works better for some people
git-svn-id: file:///home/shish/svn/shimmie2/trunk@776 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
935c235e63
commit
a649cfffc0
1 changed files with 4 additions and 3 deletions
|
@ -55,10 +55,11 @@ foreach($themelets as $filename) {
|
|||
|
||||
$custom_themelets = glob("themes/$_theme/*.theme.php");
|
||||
if($custom_themelets) {
|
||||
$m = array();
|
||||
foreach($custom_themelets as $filename) {
|
||||
$basename = str_replace($filename, "themes/$_theme/", "");
|
||||
$basename = str_replace($basename, ".theme.php", "");
|
||||
if(array_contains($themelets, "ext/$basename/theme.php")) {
|
||||
if(preg_match("/themes\/$_theme\/(.*)\.theme\.php/",$filename,$m)
|
||||
&& array_contains($themelets, "ext/{$m[1]}/theme.php"))
|
||||
{
|
||||
require_once $filename;
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue