diff --git a/bl-kernel/admin/controllers/install-theme.php b/bl-kernel/admin/controllers/install-theme.php
index f6b69bf2..91657e84 100644
--- a/bl-kernel/admin/controllers/install-theme.php
+++ b/bl-kernel/admin/controllers/install-theme.php
@@ -21,10 +21,23 @@ checkRole(array('admin'));
// ============================================================================
// Main after POST
// ============================================================================
-$themeDirectory = $layout['parameters'];
+$parameters = explode("/", $layout['parameters']);
+if(count($parameters)==2) {
+ $themeDirectory = $parameters[0];
-// Activate theme
-activateTheme($themeDirectory);
+ // Verify CSRF Token
+ $token = Sanitize::html($parameters[1]);
+ if (!$security->validateTokenCSRF($token)) {
+ Log::set(__FILE__.LOG_SEP.'Error occurred when trying to validate the tokenCSRF.', ALERT_STATUS_FAIL);
+ Log::set(__FILE__.LOG_SEP.'Token in install theme ['.$token.']', ALERT_STATUS_FAIL);
+
+ Session::destroy();
+ Redirect::page('login');
+ } else {
+ // Activate theme
+ activateTheme($themeDirectory);
+ }
+}
// Redirect
Redirect::page('themes');
diff --git a/bl-kernel/admin/views/themes.php b/bl-kernel/admin/views/themes.php
index 95393b89..f00cab5b 100644
--- a/bl-kernel/admin/views/themes.php
+++ b/bl-kernel/admin/views/themes.php
@@ -24,7 +24,7 @@ foreach ($themes as $theme) {
';
if ($theme['dirname']!=$site->theme()) {
- echo ''.$L->g('Activate').'';
+ echo ''.$L->g('Activate').'';
}
echo '
@@ -50,4 +50,4 @@ foreach ($themes as $theme) {
echo '
-';
\ No newline at end of file
+';