security: add CSRF protection and harden core handling
Add CSRF token validation and include tokens in authentication, website manager, and GrapesJS forms and requests. Harden login with password hash verification and session ID regeneration, validate database identifiers and charset, and secure upload MIME detection and filename generation. Update nullable type declarations and PHP syntax across core contracts and modules, switch the Docker image to PHP 8.4, and move the theme script asset to the end of the page. Refresh the PageBuilderBody distribution assets.
This commit is contained in:
@@ -11,7 +11,7 @@ interface PageBuilderContract
|
||||
* @param $action
|
||||
* @param PageContract|null $page
|
||||
*/
|
||||
public function handleRequest($route, $action, PageContract $page = null);
|
||||
public function handleRequest($route, $action, ?PageContract $page = null);
|
||||
|
||||
/**
|
||||
* Render the given page inside the PageBuilder.
|
||||
@@ -27,7 +27,7 @@ interface PageBuilderContract
|
||||
* @param null $language
|
||||
* @return string
|
||||
*/
|
||||
public function renderPage(PageContract $page, $language = null): string;
|
||||
public function renderPage(PageContract $page, ?string $language = null): string;
|
||||
|
||||
/**
|
||||
* Update the given page with the given data (an array of html blocks)
|
||||
@@ -44,7 +44,7 @@ interface PageBuilderContract
|
||||
* @param string|null $css
|
||||
* @return string
|
||||
*/
|
||||
public function customStyle(string $css = null);
|
||||
public function customStyle(?string $css = null);
|
||||
|
||||
/**
|
||||
* Get or set custom scripts for customizing behaviour of the page builder.
|
||||
@@ -53,7 +53,7 @@ interface PageBuilderContract
|
||||
* @param string|null $scripts
|
||||
* @return string
|
||||
*/
|
||||
public function customScripts(string $location, string $scripts = null);
|
||||
public function customScripts(string $location, ?string $scripts = null);
|
||||
|
||||
/**
|
||||
* Set a theme for the page builder.
|
||||
|
||||
@@ -61,7 +61,7 @@ interface PageContract
|
||||
* @param string|null $locale
|
||||
* @return mixed|string|null
|
||||
*/
|
||||
public function getTranslation(string $setting, $locale = null);
|
||||
public function getTranslation(string $setting, ?string $locale = null);
|
||||
|
||||
/**
|
||||
* Return the translated settings of this page.
|
||||
@@ -76,7 +76,7 @@ interface PageContract
|
||||
* @param string|null $locale
|
||||
* @return mixed
|
||||
*/
|
||||
public function getRoute($locale = null);
|
||||
public function getRoute(?string $locale = null);
|
||||
|
||||
/**
|
||||
* Get the value of the given property of this Page.
|
||||
|
||||
@@ -22,7 +22,7 @@ interface WebsiteManagerContract
|
||||
*
|
||||
* @param PageContract $page
|
||||
*/
|
||||
public function renderPageSettings(PageContract $page = null);
|
||||
public function renderPageSettings(?PageContract $page = null);
|
||||
|
||||
/**
|
||||
* Render the website manager menu settings (add/edit menu form).
|
||||
|
||||
Reference in New Issue
Block a user