Powerful and easy to use cms to build websites, blogs or ecommerce stores.
HTML backendblogblog-engineblog-platformbloggingcmscontent-managementcontent-management-systemecommerceecommerce-platformno-codepage-builderphpphp-cmsphp7php8self-hostedshopping-cartweb-applicationwebsite-builder
User key check for editor component rendering
givanzfd8e53f48d62
diff --git a/system/core/view.php b/system/core/view.phpindex 5456223..93de254 100644--- a/system/core/view.php+++ b/system/core/view.php@@ -101,10 +101,18 @@ class View {$this->templatePath = $themePath; //\Vvveb\config($this->app . '.theme', 'default') . DS;if (isset($_REQUEST['_component_ajax']) && $this->isEditor) {- //check if admin to allow override for editor- if ($admin = \Vvveb\System\User\Admin :: current()) {+ //check if user key is correct to allow override for editor+ if (($admin = \Vvveb\System\User\Admin :: current()) && ($userKey = $_POST['user_key'] ?? '') && ($adminId = $_POST['admin_id'] ?? '')) {+ $correctKey = $adminId . '-' . SITE_ID;+ $key = \Vvveb\getConfig('app.key');+ $decriptedKey = \Vvveb\decrypt($key, $userKey);++ if (($admin['admin_id'] != $adminId)|| $decriptedKey != $correctKey) {+ die('Invalid user key!');+ }+$this->component = \Vvveb\filter('/[a-z\-]+/', $_REQUEST['_component_ajax'], 80);- $this->componentCount = \Vvveb\filter('/\d+/', $_REQUEST['_component_id'] ?? 0, 4);+ $this->componentCount = \Vvveb\filter('/\d+/', $_REQUEST['_component_id'], 4);$this->componentContent = $_POST['_component_content'] ?? '';$this->html = $_POST['html'] ?? '';