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
Sanitize save global file, removed editor/* permission for editor role, reported by @m1n9yu3
givanzc8fef41ad865
diff --git a/admin/controller/editor/global-trait.php b/admin/controller/editor/global-trait.phpindex 1356108..58ccdc0 100644--- a/admin/controller/editor/global-trait.php+++ b/admin/controller/editor/global-trait.php@@ -22,6 +22,8 @@namespace Vvveb\Controller\Editor;+use function Vvveb\sanitizeFileName;+trait GlobalTrait {private function saveGlobalElements($content, $options = []) {$document = new \DomDocument();@@ -85,7 +87,7 @@ trait GlobalTrait {if (strpos($attribute, ',') !== false) {list($file, $selector) = explode(',', $attribute);- $file = html_entity_decode($file);+ $file = sanitizeFileName(html_entity_decode($file));$selector = html_entity_decode($selector);$file = $themeFolder . DS . $file;@@ -110,10 +112,10 @@ trait GlobalTrait {} else {$parent->replaceChild($importedNode, $externalNode);}*/- if (!$parent->replaceChild($importedNode, $externalNode)) {+ if (! $parent->replaceChild($importedNode, $externalNode)) {$externalNode->replaceWith($importedNode);}-+$externalNode = $importedNode;$parent = $externalNode->parentNode;$count++;diff --git a/install/sql/insert/admin/role.sql b/install/sql/insert/admin/role.sqlindex 1ce57ce..246e88a 100644--- a/install/sql/insert/admin/role.sql+++ b/install/sql/insert/admin/role.sql@@ -2,7 +2,7 @@ INSERT INTO `role` (`role_id`, `name`, `display_name`, `permissions`) VALUES(1, 'super_admin', 'Super Administrator', '{"allow":["*"], "deny":[], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites","view_other_admin","edit_other_admin"]}'),(2, 'admin', 'Administrator', '{"allow":["*","admin/user","admin/user/save"], "deny":["admin/*"], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites","view_other_admin"]}'),(3, 'site_admin', 'Site Administrator', '{"allow":["index","content/*","user/*","product/*","order/*","editor/*","media/*","settings/*","tools/*","admin/user","admin/user/save"], "deny":["settings/email/*", "tools/update/*", "tools/cron/*","settings/site/add"], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites","view_other_admin"]}'),-(4, 'editor', 'Editor', '{"allow":["index","content/*", "editor/*","media/media/scan"], "deny":[], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites"]}'),+(4, 'editor', 'Editor', '{"allow":["index","content/*", "media/media/scan"], "deny":[], "capabilities":["view_other_posts","edit_other_posts","view_other_products","edit_other_products","view_other_sites","edit_other_sites"]}'),(5, 'author', 'Author', '{"allow":["index","content/*", "media/media/scan","admin/user","admin/user/save"], "deny":[]}'),(6, 'contributor', 'Contributor', '{"allow":["index","content/*","media/media/scan","admin/user","admin/user/save"], "deny":[]}'),(7, 'shop', 'Shop', '{"allow":["index","product/*","order/*","media/media/scan"], "deny":[], "capabilities":["view_other_products","edit_other_products"]}'),