Skip to content

Commit 167b592

Browse files
committed
Backport fixes from 2.0
1 parent baa41ac commit 167b592

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Diff for: modules/cms/controllers/Themes.php

+8
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,10 @@ protected function makeExportFormWidget($theme)
265265

266266
public function index_onLoadImportForm()
267267
{
268+
if (\Cms\Helpers\Cms::safeModeEnabled()) {
269+
throw new ApplicationException(trans('cms::lang.cms_object.safe_mode_enabled'));
270+
}
271+
268272
$theme = $this->findThemeObject();
269273
$this->vars['widget'] = $this->makeImportFormWidget($theme);
270274
$this->vars['themeDir'] = $theme->getDirName();
@@ -274,6 +278,10 @@ public function index_onLoadImportForm()
274278

275279
public function index_onImport()
276280
{
281+
if (\Cms\Helpers\Cms::safeModeEnabled()) {
282+
throw new ApplicationException(trans('cms::lang.cms_object.safe_mode_enabled'));
283+
}
284+
277285
$theme = $this->findThemeObject();
278286
$widget = $this->makeImportFormWidget($theme);
279287

Diff for: modules/system/twig/SecurityPolicy.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,22 @@ final class SecurityPolicy implements SecurityPolicyInterface
1818
* @var array List of forbidden methods.
1919
*/
2020
protected $blockedMethods = [
21-
// \October\Rain\Extension\ExtendableTrait
21+
// Prevent manipulating Twig itself
22+
'getTwig',
23+
24+
// Prevent dynamic methods and props
2225
'addDynamicMethod',
2326
'addDynamicProperty',
2427

25-
// \October\Rain\Support\Traits\Emitter
28+
// Prevent binding event logic
2629
'bindEvent',
2730
'bindEventOnce',
2831

2932
// Eloquent & Halcyon data modification
3033
'insert',
3134
'update',
3235
'delete',
36+
'write',
3337
];
3438

3539
/**

0 commit comments

Comments
 (0)