Avoid loading themes from non directories, . and ..

This commit is contained in:
Michal Čihař
2011-08-17 13:32:27 +02:00
committed by Marc Delisle
parent 7ed2f6f362
commit 15f887a979

View File

@@ -231,6 +231,10 @@ class PMA_Theme_Manager
if ($handleThemes = opendir($this->getThemesPath())) {
// check for themes directory
while (false !== ($PMA_Theme = readdir($handleThemes))) {
// Skip non dirs, . and ..
if ($PMA_Theme == '.' || $PMA_Theme == '..' || ! is_dir($this->getThemesPath() . '/' . $PMA_Theme)) {
continue;
}
if (array_key_exists($PMA_Theme, $this->themes)) {
// this does nothing!
//$this->themes[$PMA_Theme] = $this->themes[$PMA_Theme];