add support for a theme request parameter (fixes #51)
* includes/galleryfunctions.php: - check for request parameter theme and whether it matches an allowed directory name * includes/theme.class.php: - die if the theme cannot be initialized properly
This commit is contained in:
parent
ded7232146
commit
5be4c55b97
2 changed files with 13 additions and 4 deletions
|
@ -64,9 +64,12 @@ class Theme {
|
|||
* @param string $name the directory name of the theme
|
||||
*/
|
||||
function __construct($name) {
|
||||
$themeconfig = parse_ini_file(
|
||||
realpath(implode(DIRECTORY_SEPARATOR,
|
||||
array('themes', $name, 'theme.ini'))));
|
||||
$themeini = realpath(implode(DIRECTORY_SEPARATOR,
|
||||
array('themes', $name, 'theme.ini')));
|
||||
if (!$themeini) {
|
||||
die("invalid theme $name");
|
||||
}
|
||||
$themeconfig = parse_ini_file($themeini);
|
||||
$this->name = $name;
|
||||
$this->themetype = $themeconfig['themetype'];
|
||||
$this->previewsize = intval($themeconfig['previewsize']);
|
||||
|
|
Reference in a new issue