Ticket #2638: allow themes to specify a base theme to load with 'include' setting in a theme.ini file

This commit is contained in:
Brion Vibber
2010-09-02 14:11:52 -07:00
parent 11f7fce3bb
commit c24458a9f0
4 changed files with 82 additions and 4 deletions

View File

@@ -198,7 +198,7 @@ class ThemeUploader
protected function validateFile($filename, $ext)
{
$this->validateFileOrFolder($filename);
$this->validateExtension($ext);
$this->validateExtension($filename, $ext);
// @fixme validate content
}
@@ -216,13 +216,17 @@ class ThemeUploader
return true;
}
protected function validateExtension($ext)
protected function validateExtension($base, $ext)
{
$allowed = array('css', // CSS may need validation
'png', 'gif', 'jpg', 'jpeg',
'svg', // SVG images/fonts may need validation
'ttf', 'eot', 'woff');
if (!in_array(strtolower($ext), $allowed)) {
if ($ext == 'ini' && $base == 'theme') {
// theme.ini exception
return true;
}
$msg = sprintf(_("Theme contains file of type '.%s', " .
"which is not allowed."),
$ext);