2 changes: 1 addition & 1 deletion contao/popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function run()
$this->Template->atime = Date::parse($GLOBALS['TL_CONFIG']['datimFormat'], $objFile->atime);
$this->Template->filesize = $this->getReadableSize($objFile->filesize) . ' (' . number_format($objFile->filesize, 0, $GLOBALS['TL_LANG']['MSC']['decimalSeparator'], $GLOBALS['TL_LANG']['MSC']['thousandsSeparator']) . ' Byte)';
$this->Template->href = ampersand(Environment::get('request'), true) . '&download=1';
$this->Template->path = $this->strFile;
$this->Template->path = specialchars($this->strFile);

// Image
if ($objFile->isGdImage)
Expand Down
2 changes: 1 addition & 1 deletion system/config/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Core version
*/
define('VERSION', '3.2');
define('BUILD', '20');
define('BUILD', '21');
define('LONG_TERM_SUPPORT', true);


Expand Down
7 changes: 7 additions & 0 deletions system/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Contao Open Source CMS changelog
================================

Version 3.2.21 (2015-06-05)
---------------------------

### Fixed
Back-ported two security related changes from the upstream versions.


Version 3.2.20 (2015-03-26)
---------------------------

Expand Down
5 changes: 3 additions & 2 deletions system/helper/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,17 +216,18 @@ function scan($strFolder, $blnUncached=false)
* entities are never double converted.
* @param string
* @param boolean
* @param boolean
* @return string
*/
function specialchars($strString, $blnStripInsertTags=false)
function specialchars($strString, $blnStripInsertTags=false, $blnDoubleEncode=false)
{
if ($blnStripInsertTags)
{
$strString = strip_insert_tags($strString);
}

// Use ENT_COMPAT here (see #4889)
return htmlspecialchars($strString, ENT_COMPAT, $GLOBALS['TL_CONFIG']['characterSet'], false);
return htmlspecialchars($strString, ENT_COMPAT, $GLOBALS['TL_CONFIG']['characterSet'], $blnDoubleEncode);
}


Expand Down
8 changes: 4 additions & 4 deletions system/modules/core/classes/BackendUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function isAllowed($int, $row)
->limit(1)
->execute($pid);

while (!$row['chmod'] && $pid > 0 && $objParentPage->numRows)
while ($row['chmod'] === false && $pid > 0 && $objParentPage->numRows)
{
$pid = $objParentPage->pid;

Expand All @@ -259,15 +259,15 @@ public function isAllowed($int, $row)
}

// Set default values
if (!$row['chmod'])
if ($row['chmod'] === false)
{
$row['chmod'] = $GLOBALS['TL_CONFIG']['defaultChmod'];
}
if (!$row['cuser'])
if ($row['cuser'] === false)
{
$row['cuser'] = intval($GLOBALS['TL_CONFIG']['defaultUser']);
}
if (!$row['cgroup'])
if ($row['cgroup'] === false)
{
$row['cgroup'] = intval($GLOBALS['TL_CONFIG']['defaultGroup']);
}
Expand Down
14 changes: 7 additions & 7 deletions system/modules/core/dca/tl_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public function syncFiles($href, $label, $title, $class, $attributes)
*/
public function editFile($row, $href, $label, $title, $icon, $attributes)
{
return ($this->User->isAdmin || $this->User->hasAccess('f2', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
return ($this->User->isAdmin || $this->User->hasAccess('f2', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title, false, true).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
}


Expand All @@ -434,7 +434,7 @@ public function editFile($row, $href, $label, $title, $icon, $attributes)
*/
public function copyFile($row, $href, $label, $title, $icon, $attributes)
{
return ($this->User->isAdmin || $this->User->hasAccess('f2', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
return ($this->User->isAdmin || $this->User->hasAccess('f2', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title, false, true).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
}


Expand All @@ -450,7 +450,7 @@ public function copyFile($row, $href, $label, $title, $icon, $attributes)
*/
public function cutFile($row, $href, $label, $title, $icon, $attributes)
{
return ($this->User->isAdmin || $this->User->hasAccess('f2', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
return ($this->User->isAdmin || $this->User->hasAccess('f2', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title, false, true).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
}


Expand All @@ -468,11 +468,11 @@ public function deleteFile($row, $href, $label, $title, $icon, $attributes)
{
if (is_dir(TL_ROOT . '/' . $row['id']) && count(scan(TL_ROOT . '/' . $row['id'])) > 0)
{
return ($this->User->isAdmin || $this->User->hasAccess('f4', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
return ($this->User->isAdmin || $this->User->hasAccess('f4', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title, false, true).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
}
else
{
return ($this->User->isAdmin || $this->User->hasAccess('f3', 'fop') || $this->User->hasAccess('f4', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
return ($this->User->isAdmin || $this->User->hasAccess('f3', 'fop') || $this->User->hasAccess('f4', 'fop')) ? '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title, false, true).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ' : Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
}
}

Expand Down Expand Up @@ -508,7 +508,7 @@ public function editSource($row, $href, $label, $title, $icon, $attributes)
return Image::getHtml(preg_replace('/\.gif$/i', '_.gif', $icon)).' ';
}

return '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ';
return '<a href="'.$this->addToUrl($href.'&amp;id='.$row['id']).'" title="'.specialchars($title, false, true).'"'.$attributes.'>'.Image::getHtml($icon, $label).'</a> ';
}


Expand All @@ -530,7 +530,7 @@ public function showFile($row, $href, $label, $title, $icon, $attributes)
}
else
{
return '<a href="contao/popup.php?src=' . base64_encode($row['id']) . '" title="'.specialchars($title).'"'.$attributes.' onclick="Backend.openModalIframe({\'width\':'.$row['popupWidth'].',\'title\':\''.str_replace("'", "\\'", $row['fileNameEncoded']).'\',\'url\':this.href,\'height\':'.$row['popupHeight'].'});return false">'.Image::getHtml($icon, $label).'</a> ';
return '<a href="contao/popup.php?src=' . base64_encode($row['id']) . '" title="'.specialchars($title, false, true).'"'.$attributes.' onclick="Backend.openModalIframe({\'width\':'.$row['popupWidth'].',\'title\':\''.str_replace("'", "\\'", $row['fileNameEncoded']).'\',\'url\':this.href,\'height\':'.$row['popupHeight'].'});return false">'.Image::getHtml($icon, $label).'</a> ';
}
}

Expand Down
1 change: 1 addition & 0 deletions system/modules/repository/classes/RepositorySettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
'30030007,30030007;'. // 3.3.0-RC2
'30030006,30030006;'. // 3.3.0-RC1
'30030003,30030003;'. // 3.3.0-beta1
'30020219,30020219;'. // 3.2.21
'30020209,30020209;'. // 3.2.20
'30020199,30020199;'. // 3.2.19
'30020189,30020189;'. // 3.2.18
Expand Down