Skip to content
Permalink
Browse files

Improve robustness against misconfiguration

  • Loading branch information...
flack committed Oct 8, 2019
1 parent 876d54b commit 663bcc8de671bb2d3dc53dc839bd831a624b4526
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/midcom/admin/folder/management.php
@@ -130,10 +130,12 @@ public static function list_styles($up = 0, $prefix = '/', $spacer = '') : array
public static function list_theme_styles(array $styles) : array
{
$theme_styledir = OPENPSA2_THEME_ROOT . '/' . midcom::get()->config->get('theme') . '/style';
if (is_dir($theme_styledir)) {
$finder = new Finder();
foreach ($finder->directories()->in($theme_styledir) as $dir) {
$label = preg_replace('/.+?\//', '  ', $dir->getRelativePathname());
$styles['theme:/' . $dir->getRelativePathname()] = $label;
foreach ($finder->directories()->in($theme_styledir) as $dir) {
$label = preg_replace('/.+?\//', '  ', $dir->getRelativePathname());
$styles['theme:/' . $dir->getRelativePathname()] = $label;
}
}
return $styles;
}

0 comments on commit 663bcc8

Please sign in to comment.
You can’t perform that action at this time.