From 15f887a979a1a6323b9a7d50f0462c63f489e954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 17 Aug 2011 13:32:27 +0200 Subject: [PATCH] Avoid loading themes from non directories, . and .. --- libraries/Theme_Manager.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/Theme_Manager.class.php b/libraries/Theme_Manager.class.php index 4ca8517da..31163d1f4 100644 --- a/libraries/Theme_Manager.class.php +++ b/libraries/Theme_Manager.class.php @@ -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];