Skip to content
This repository was archived by the owner on Feb 13, 2026. It is now read-only.

Commit 5e2f266

Browse files
committed
Merge branch 'hotfix/3.5.24'
2 parents af729dc + 0081d46 commit 5e2f266

8 files changed

Lines changed: 51 additions & 58 deletions

File tree

build.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
</target>
88

99
<target name="clone">
10+
<echo message="Cloning into contao-${version}" />
1011
<exec executable="git">
1112
<arg value="clone" />
1213
<arg value="." />

system/config/constants.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Core version
1414
*/
1515
define('VERSION', '3.5');
16-
define('BUILD', '23');
16+
define('BUILD', '24');
1717
define('LONG_TERM_SUPPORT', true);
1818

1919

system/docs/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Contao Open Source CMS changelog
22
================================
33

4+
Version 3.5.24 (2017-01-19)
5+
---------------------------
6+
7+
### Fixed
8+
Correctly handle SVGZ files in the file manager (also fixes #8624).
9+
10+
### Fixed
11+
Revert the download element changes (see #8620).
12+
13+
414
Version 3.5.23 (2017-01-17)
515
---------------------------
616

system/modules/core/classes/Versions.php

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ class Versions extends \Controller
3131
*/
3232
protected $intPid;
3333

34-
/**
35-
* File path
36-
* @var string
37-
*/
38-
protected $strPath;
39-
4034
/**
4135
* Edit URL
4236
* @var string
@@ -69,17 +63,6 @@ public function __construct($strTable, $intPid)
6963

7064
$this->strTable = $strTable;
7165
$this->intPid = $intPid;
72-
73-
// Store the path if it is an editable file
74-
if ($strTable == 'tl_files')
75-
{
76-
$objFile = \FilesModel::findByPk($intPid);
77-
78-
if ($objFile !== null && in_array($objFile->extension, trimsplit(',', strtolower(\Config::get('editableFiles')))))
79-
{
80-
$this->strPath = $objFile->path;
81-
}
82-
}
8366
}
8467

8568

@@ -163,17 +146,23 @@ public function create()
163146
return;
164147
}
165148

166-
if ($this->strPath !== null)
149+
// Store the content if it is an editable file
150+
if ($this->strTable == 'tl_files')
167151
{
168-
$objFile = new \File($this->strPath, true);
152+
$objModel = \FilesModel::findByPk($this->intPid);
169153

170-
if ($objFile->extension == 'svgz')
154+
if ($objModel !== null && in_array($objModel->extension, trimsplit(',', strtolower(\Config::get('editableFiles')))))
171155
{
172-
$objRecord->content = gzdecode($objFile->getContent());
173-
}
174-
else
175-
{
176-
$objRecord->content = $objFile->getContent();
156+
$objFile = new \File($objModel->path, true);
157+
158+
if ($objFile->extension == 'svgz')
159+
{
160+
$objRecord->content = gzdecode($objFile->getContent());
161+
}
162+
else
163+
{
164+
$objRecord->content = $objFile->getContent();
165+
}
177166
}
178167
}
179168

@@ -278,12 +267,26 @@ public function restore($intVersion)
278267
return;
279268
}
280269

281-
// Restore the content
282-
if ($this->strPath !== null)
270+
// Restore the content if it is an editable file
271+
if ($this->strTable == 'tl_files')
283272
{
284-
$objFile = new \File($this->strPath, true);
285-
$objFile->write($data['content']);
286-
$objFile->close();
273+
$objModel = \FilesModel::findByPk($this->intPid);
274+
275+
if ($objModel !== null && in_array($objModel->extension, trimsplit(',', strtolower(\Config::get('editableFiles')))))
276+
{
277+
$objFile = new \File($objModel->path, true);
278+
279+
if ($objFile->extension == 'svgz')
280+
{
281+
$objFile->write(gzencode($data['content']));
282+
}
283+
else
284+
{
285+
$objFile->write($data['content']);
286+
}
287+
288+
$objFile->close();
289+
}
287290
}
288291

289292
// Get the currently available fields

system/modules/core/drivers/DC_Folder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,6 +2012,8 @@ protected function save($varValue)
20122012
{
20132013
\Dbafs::addResource($this->strPath . '/' . $varValue . $this->strExtension);
20142014
}
2015+
2016+
$this->blnCreateNewVersion = true;
20152017
}
20162018

20172019
$this->log('File or folder "'.$this->strPath.'/'.$this->varValue.$this->strExtension.'" has been renamed to "'.$this->strPath.'/'.$varValue.$this->strExtension.'"', __METHOD__, TL_FILES);

system/modules/core/elements/ContentDownload.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,7 @@ protected function compile()
8585
$this->linkTitle = specialchars($objFile->basename);
8686
}
8787

88-
/** @var \PageModel $objPage */
89-
global $objPage;
90-
91-
if ($objPage instanceof \PageModel)
92-
{
93-
$strHref = $objPage->getFrontendUrl() . (Environment::get('queryString') ? '?' . Environment::get('queryString') : '');
94-
}
95-
else
96-
{
97-
$strHref = \Environment::get('request');
98-
}
88+
$strHref = \Environment::get('request');
9989

10090
// Remove an existing file parameter (see #5683)
10191
if (preg_match('/(&(amp;)?|\?)file=/', $strHref))

system/modules/core/elements/ContentDownloads.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,14 +146,7 @@ protected function compile()
146146
$arrMeta['title'] = specialchars($objFile->basename);
147147
}
148148

149-
if ($objPage instanceof \PageModel)
150-
{
151-
$strHref = $objPage->getFrontendUrl() . (Environment::get('queryString') ? '?' . Environment::get('queryString') : '');
152-
}
153-
else
154-
{
155-
$strHref = \Environment::get('request');
156-
}
149+
$strHref = \Environment::get('request');
157150

158151
// Remove an existing file parameter (see #5683)
159152
if (preg_match('/(&(amp;)?|\?)file=/', $strHref))
@@ -229,14 +222,7 @@ protected function compile()
229222
$arrMeta['title'] = specialchars($objFile->basename);
230223
}
231224

232-
if ($objPage instanceof \PageModel)
233-
{
234-
$strHref = $objPage->getFrontendUrl() . (Environment::get('queryString') ? '?' . Environment::get('queryString') : '');
235-
}
236-
else
237-
{
238-
$strHref = \Environment::get('request');
239-
}
225+
$strHref = \Environment::get('request');
240226

241227
// Remove an existing file parameter (see #5683)
242228
if (preg_match('/(&(amp;)?|\?)file=/', $strHref))

system/modules/repository/classes/RepositorySettings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
// valid core versions in descending order
1919
define('REPOSITORY_COREVERSIONS',
20+
'30050249,30050249;'. // 3.5.24
2021
'30050239,30050239;'. // 3.5.23
2122
'30050229,30050229;'. // 3.5.22
2223
'30050219,30050219;'. // 3.5.21

0 commit comments

Comments
 (0)