Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/3.5.31'
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Nov 15, 2017
2 parents 2474ff9 + 0a88b04 commit 3e41ad8
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 81 deletions.
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.5');
define('BUILD', '30');
define('BUILD', '31');
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.5.31 (2017-11-15)
---------------------------

### Fixed
Prevent SQL injections in the back end search panel (see CVE-2017-16558).


Version 3.5.30 (2017-10-06)
---------------------------

Expand Down
1 change: 1 addition & 0 deletions system/modules/calendar/languages/pl/default.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</trans-unit>
<trans-unit id="MSC.cal_timeSeparator">
<source>–</source>
<target>–</target>
</trans-unit>
<trans-unit id="MSC.cal_emptyDay">
<source>There are no events on this day.</source>
Expand Down
28 changes: 19 additions & 9 deletions system/modules/core/drivers/DC_Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4943,23 +4943,33 @@ protected function searchMenu()
// Store search value in the current session
if (\Input::post('FORM_SUBMIT') == 'tl_filters')
{
$session['search'][$this->strTable]['value'] = '';
$session['search'][$this->strTable]['field'] = \Input::post('tl_field', true);
$strField = \Input::post('tl_field', true);
$strKeyword = ltrim(\Input::postRaw('tl_value'), '*');

if ($strField && !in_array($strField, $searchFields, true))
{
$strField = '';
$strKeyword = '';
}

// Make sure the regular expression is valid
if (\Input::postRaw('tl_value') != '')
if ($strField && $strKeyword)
{
try
{
$this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE " . \Input::post('tl_field', true) . " REGEXP ?")
$this->Database->prepare("SELECT * FROM " . $this->strTable . " WHERE " . $strField . " REGEXP ?")
->limit(1)
->execute(\Input::postRaw('tl_value'));

$session['search'][$this->strTable]['value'] = \Input::postRaw('tl_value');
->execute($strKeyword);
}
catch (\Exception $e)
{
$strKeyword = '';
}
catch (\Exception $e) {}
}

$session['search'][$this->strTable]['field'] = $strField;
$session['search'][$this->strTable]['value'] = $strKeyword;

$this->Session->setData($session);
}

Expand Down Expand Up @@ -5060,7 +5070,7 @@ protected function sortMenu()
$strSort = \Input::post('tl_sort');

// Validate the user input (thanks to aulmn) (see #4971)
if (in_array($strSort, $sortingFields))
if (in_array($strSort, $sortingFields, true))
{
$session['sorting'][$this->strTable] = in_array($GLOBALS['TL_DCA'][$this->strTable]['fields'][$strSort]['flag'], array(2, 4, 6, 8, 10, 12)) ? "$strSort DESC" : $strSort;
$this->Session->setData($session);
Expand Down
2 changes: 1 addition & 1 deletion system/modules/core/languages/pl/tl_files.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
</trans-unit>
<trans-unit id="tl_files.new.0">
<source>New folder</source>
<target>Nowy szablon</target>
<target>Nowy folder</target>
</trans-unit>
<trans-unit id="tl_files.new.1">
<source>Create a new folder</source>
Expand Down
1 change: 1 addition & 0 deletions system/modules/core/languages/pl/tl_settings.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@
</trans-unit>
<trans-unit id="tl_settings.maxImageWidth.1">
<source>If the width of an image or movie exceeds this value, it will be adjusted automatically. Set to 0 to disable the limit.</source>
<target>Jeśli szerokość obrazka lub filmu przekroczy tą wartość, element zostanie automatycznie dostosowany. Wprowadź 0, aby wyłączyć limit.</target>
</trans-unit>
<trans-unit id="tl_settings.jpgQuality.0">
<source>JPG thumbnail quality</source>
Expand Down
4 changes: 2 additions & 2 deletions system/modules/core/library/Contao/StringUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,13 @@ function (array $matches) use ($arrData)
$blnCurrent = $arrStack[count($arrStack) - 1];
$blnCurrentIf = $arrIfStack[count($arrIfStack) - 1];

if (strncmp($strTag, '{if', 3) === 0)
if (strncmp($strTag, '{if ', 4) === 0)
{
$blnExpression = $evaluateExpression(substr($strTag, 4, -1));
$arrStack[] = $blnCurrent && $blnExpression;
$arrIfStack[] = $blnExpression;
}
elseif (strncmp($strTag, '{elseif', 7) === 0)
elseif (strncmp($strTag, '{elseif ', 8) === 0)
{
$blnExpression = $evaluateExpression(substr($strTag, 8, -1));
array_pop($arrStack);
Expand Down
Loading

0 comments on commit 3e41ad8

Please sign in to comment.