Check to make sure that skin and css are valid.
This commit is contained in:
parent
c3f96ad8ca
commit
8eb8cacd56
|
@ -68,15 +68,27 @@ elseif ( ZM_SKIN_DEFAULT )
|
|||
else
|
||||
$skin = "classic";
|
||||
|
||||
$skins = array_map( 'basename', glob('skins/*',GLOB_ONLYDIR) );
|
||||
if ( ! in_array( $skin, $skins ) ) {
|
||||
Fatal( "Invalid skin '$skin'" );
|
||||
$skin = 'classic';
|
||||
}
|
||||
|
||||
if ( isset($_GET['css']) )
|
||||
$css = $_GET['css'];
|
||||
elseif ( isset($_COOKIE['zmCSS']) )
|
||||
$css = $_COOKIE['zmCSS'];
|
||||
elseif (ZM_CSS_DEFAULT)
|
||||
elseif (defined(ZM_CSS_DEFAULT))
|
||||
$css = ZM_CSS_DEFAULT;
|
||||
else
|
||||
$css = "classic";
|
||||
|
||||
$css_skins = array_map( 'basename', glob('skins/'.$skin.'/css/*',GLOB_ONLYDIR) );
|
||||
if ( ! in_array( $css, $css_skins ) ) {
|
||||
Fatal( "Invalid skin css '$css'" );
|
||||
$css = 'classic';
|
||||
}
|
||||
|
||||
define( "ZM_BASE_PATH", dirname( $_SERVER['REQUEST_URI'] ) );
|
||||
define( "ZM_SKIN_PATH", "skins/$skin" );
|
||||
|
||||
|
|
Loading…
Reference in New Issue