From b1954e92586f33a345068d56b957d7e366a5ba71 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Thu, 30 Jul 2020 10:35:02 -0600 Subject: [PATCH 1/3] Fix creating asset files Fixes #5228 --- modules/cms/classes/Asset.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/cms/classes/Asset.php b/modules/cms/classes/Asset.php index 1073f8ed8..12b79ea35 100644 --- a/modules/cms/classes/Asset.php +++ b/modules/cms/classes/Asset.php @@ -285,9 +285,22 @@ class Asset extends Extendable $fileName = $this->fileName; } - // Limit paths to those under the assets directory $directory = $this->theme->getPath() . '/' . $this->dirName . '/'; - $path = realpath($directory . $fileName); + $filePath = $directory . $fileName; + $path = realpath($filePath); + + /** + * If the path doesn't exist yet, then create it temporarily + * in order to run realpath() resolution on it to verify the + * final destination and then remove the temporary file. + */ + if (!$path) { + touch($filePath); + $path = realpath($filePath); + unlink($filePath); + } + + // Limit paths to those under the theme's assets directory if (!starts_with($path, $directory)) { return false; } From 18af35d928956b3ebae636a0996add74d683bec8 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Thu, 30 Jul 2020 10:54:09 -0600 Subject: [PATCH 2/3] Prevent error from occurring when the active sorting column is hidden from the results. Fixes #5227 --- modules/backend/widgets/Lists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index bc83c11f6..51a425c2c 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -522,7 +522,7 @@ class Lists extends WidgetBase /* * Apply sorting */ - if (($sortColumn = $this->getSortColumn()) && !$this->showTree) { + if (($sortColumn = $this->getSortColumn()) && !$this->showTree && in_array($sortColumn, array_keys($this->getVisibleColumns()))) { if (($column = array_get($this->allColumns, $sortColumn)) && $column->valueFrom) { $sortColumn = $this->isColumnPivot($column) ? 'pivot_' . $column->valueFrom From df2b8b5817419caefe7f8fc3124ed3081da4a125 Mon Sep 17 00:00:00 2001 From: Ben Thomson Date: Mon, 3 Aug 2020 11:07:55 +0800 Subject: [PATCH 3/3] Recompile Storm UI JS asset --- modules/system/assets/ui/storm-min.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js index 632ec830d..e5b26e6a0 100644 --- a/modules/system/assets/ui/storm-min.js +++ b/modules/system/assets/ui/storm-min.js @@ -5805,7 +5805,8 @@ TextEditor.prototype.getPopupContent=function(){return'
\