diff options
author | Brion Vibber <brion@pobox.com> | 2010-09-02 14:11:52 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-09-02 14:11:52 -0700 |
commit | c24458a9f047ba68f0ef8ff4307562df6c4f3611 (patch) | |
tree | 0ff8f476702b701c237c54630c5114468d17ed16 /lib/themeuploader.php | |
parent | 11f7fce3bb59af46dd76c1e219f8df04de9e03af (diff) |
Ticket #2638: allow themes to specify a base theme to load with 'include' setting in a theme.ini file
Diffstat (limited to 'lib/themeuploader.php')
-rw-r--r-- | lib/themeuploader.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/themeuploader.php b/lib/themeuploader.php index abf0658d3..b5ef92e7b 100644 --- a/lib/themeuploader.php +++ b/lib/themeuploader.php @@ -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); |