Showing with 329 additions and 730 deletions.
  1. +1 −1 .travis.yml
  2. +10 −0 CHANGELOG.md
  3. +35 −34 composer.json
  4. +3 −3 src/Cache/ContaoCacheWarmer.php
  5. +20 −16 src/Command/SymlinksCommand.php
  6. +1 −1 src/DependencyInjection/Configuration.php
  7. +48 −0 src/Resources/contao/classes/Backend.php
  8. +11 −3 src/Resources/contao/classes/DataContainer.php
  9. +8 −5 src/Resources/contao/classes/Frontend.php
  10. +33 −30 src/Resources/contao/classes/Versions.php
  11. +1 −1 src/Resources/contao/config/constants.php
  12. +6 −23 src/Resources/contao/dca/tl_article.php
  13. +22 −21 src/Resources/contao/dca/tl_form.php
  14. +2 −1 src/Resources/contao/dca/tl_layout.php
  15. +7 −13 src/Resources/contao/dca/tl_module.php
  16. +2 −0 src/Resources/contao/drivers/DC_Folder.php
  17. +0 −32 src/Resources/contao/languages/cs/tl_settings.xlf
  18. +0 −32 src/Resources/contao/languages/da/tl_settings.xlf
  19. +0 −32 src/Resources/contao/languages/de/tl_settings.xlf
  20. +0 −24 src/Resources/contao/languages/en/tl_settings.xlf
  21. +0 −32 src/Resources/contao/languages/es/tl_settings.xlf
  22. +0 −32 src/Resources/contao/languages/fa/tl_settings.xlf
  23. +0 −32 src/Resources/contao/languages/fr/tl_settings.xlf
  24. +0 −32 src/Resources/contao/languages/hu/tl_settings.xlf
  25. +1 −0 src/Resources/contao/languages/it/default.xlf
  26. +0 −32 src/Resources/contao/languages/it/tl_settings.xlf
  27. +1 −0 src/Resources/contao/languages/ja/default.xlf
  28. +1 −0 src/Resources/contao/languages/ja/exception.xlf
  29. +0 −32 src/Resources/contao/languages/ja/tl_settings.xlf
  30. +0 −32 src/Resources/contao/languages/nl/tl_settings.xlf
  31. +0 −32 src/Resources/contao/languages/pl/tl_settings.xlf
  32. +0 −32 src/Resources/contao/languages/rm/tl_settings.xlf
  33. +0 −32 src/Resources/contao/languages/ru/tl_settings.xlf
  34. +19 −0 src/Resources/contao/languages/sl/default.xlf
  35. +2 −0 src/Resources/contao/languages/sl/tl_files.xlf
  36. +1 −0 src/Resources/contao/languages/sl/tl_member.xlf
  37. +0 −32 src/Resources/contao/languages/sl/tl_settings.xlf
  38. +5 −0 src/Resources/contao/languages/sl/tl_theme.xlf
  39. +1 −0 src/Resources/contao/languages/sl/tl_user.xlf
  40. +0 −32 src/Resources/contao/languages/sv/tl_settings.xlf
  41. +0 −32 src/Resources/contao/languages/zh/tl_settings.xlf
  42. +3 −3 src/Resources/contao/library/Contao/Controller.php
  43. +8 −1 src/Resources/contao/library/Contao/File.php
  44. +2 −2 src/Resources/contao/library/Contao/InsertTags.php
  45. +8 −1 src/Resources/contao/library/Contao/Model.php
  46. +2 −2 src/Resources/contao/library/Contao/Picture.php
  47. +1 −1 src/Resources/contao/themes/flexible/main.css
  48. +3 −0 src/Resources/contao/themes/flexible/src/main.css
  49. +31 −4 src/Resources/contao/widgets/ImageSize.php
  50. +9 −5 src/Resources/contao/widgets/ModuleWizard.php
  51. +16 −18 src/Resources/views/Error/layout.html.twig
  52. +5 −5 tests/Contao/PictureTest.php
  53. 0 tests/Fixtures/system/modules/foobar/html/foo/{ → bar}/.htaccess
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ matrix:
fast_finish: true

before_install:
- composer selfupdate --snapshot # TODO: remove when Composer 1.3 stable is released
- composer selfupdate

before_script:
- travis_wait composer update $COMPOSER_FLAGS --no-interaction
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Contao core bundle change log

### 4.3.2 (2017-01-18)

* Correctly handle nested public folders when symlinking a folder.
* Correctly handle SVGZ files in the file manager (see contao/core#8624).
* Prevent an endless redirect loop if the page alias is "/" (see contao/core#8560).
* Correctly parse German dates with two digit years in MooTools (see contao/core#8593).
* Correctly add new resources to the user/group permissions (see contao/core#8583).
* Trigger the auto-submit function in the date picker (see contao/core#8603).
* Call the load callback when loading page/file picker nodes (see contao/core#7702).

### 4.3.1 (2016-12-22)

* Preserve uppercase characters in custom sections IDs (see #639).
Expand Down
69 changes: 35 additions & 34 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,56 @@
"ext-dom": "*",
"ext-gd": "*",
"ext-pcre": "*",
"symfony/framework-bundle": "~2.8|~3.0",
"symfony/console": "~2.8|~3.0",
"symfony/filesystem": "~2.8|~3.0",
"symfony/finder": "~2.8|~3.0",
"symfony/http-foundation": "~2.8|~3.0",
"symfony/security": "~2.8|~3.0",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/yaml": "~2.8|~3.0",
"symfony/framework-bundle": "^2.8|^3.0",
"symfony/console": "^2.8|^3.0",
"symfony/filesystem": "^2.8|^3.0",
"symfony/finder": "^2.8|^3.0",
"symfony/http-foundation": "^2.8|^3.0",
"symfony/security": "^2.8|^3.0",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/yaml": "^2.8|^3.0",
"sensio/framework-extra-bundle": "^3.0.2",
"psr/log": "~1.0",
"twig/twig": "~1.20",
"doctrine/dbal": "~2.5",
"doctrine/doctrine-bundle": "~1.6",
"doctrine/doctrine-cache-bundle": "~1.3",
"swiftmailer/swiftmailer": "^5.2.1",
"psr/log": "^1.0",
"twig/twig": "^1.20",
"doctrine/dbal": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.3",
"swiftmailer/swiftmailer": "^5.4.5",
"imagine/imagine": "^0.6",
"knplabs/knp-time-bundle": "^1.5.2",
"leafo/scssphp": "^0.6",
"league/uri": "~4.0",
"matthiasmullie/minify": "~1.3",
"michelf/php-markdown": "~1.4",
"oyejorge/less.php": "~1.7",
"patchwork/utf8": "~1.2",
"phpspec/php-diff": "~1.0",
"simplepie/simplepie": "~1.3",
"tecnickcom/tcpdf": "~6.0",
"true/punycode": "~1.0",
"league/uri": "^4.0",
"matthiasmullie/minify": "^1.3",
"michelf/php-markdown": "^1.4",
"oyejorge/less.php": "^1.7",
"patchwork/utf8": "^1.2",
"phpspec/php-diff": "^1.0",
"simplepie/simplepie": "^1.3",
"tecnickcom/tcpdf": "^6.0",
"true/punycode": "^1.0",
"contao/image": "^0.3.1",
"contao/imagine-svg": "^0.1.2",
"contao-components/all": "~6.0"
"contao-components/all": "^6.0"
},
"require-dev": {
"ext-fileinfo": "*",
"composer/composer": "~1.0",
"contao/manager-plugin": "~1.0",
"doctrine/orm": "~2.5",
"doctrine/doctrine-migrations-bundle": "~1.1",
"friendsofphp/php-cs-fixer": "~1.8",
"lexik/maintenance-bundle": "~2.0",
"monolog/monolog": "~1.11",
"phpunit/phpunit": "~4.5",
"satooshi/php-coveralls": "~1.0",
"symfony/phpunit-bridge": "~2.8|~3.0"
"composer/composer": "^1.0",
"contao/manager-plugin": "^0.2",
"doctrine/orm": "^2.5",
"doctrine/doctrine-migrations-bundle": "^1.1",
"friendsofphp/php-cs-fixer": "^1.8",
"lexik/maintenance-bundle": "^2.0",
"monolog/monolog": "^1.11",
"phpunit/phpunit": "^4.5",
"satooshi/php-coveralls": "^1.0",
"symfony/phpunit-bridge": "^2.8|^3.0"
},
"suggest": {
"lexik/maintenance-bundle": "To put the application into maintenance mode"
},
"conflict": {
"contao/core": "*",
"contao/manager-plugin": "!=0.2",
"doctrine/orm": "<2.4",
"doctrine/doctrine-migrations-bundle": "<1.1"
},
Expand Down
6 changes: 3 additions & 3 deletions src/Cache/ContaoCacheWarmer.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ private function findConfigFiles($name)
/**
* Returns the DCA files.
*
* @return Finder|SplFileInfo[]
* @return Finder|SplFileInfo[]|array
*/
private function findDcaFiles()
{
Expand All @@ -337,7 +337,7 @@ private function findDcaFiles()
*
* @param string $language
*
* @return Finder|SplFileInfo[]
* @return Finder|SplFileInfo[]|array
*/
private function findLanguageFiles($language)
{
Expand All @@ -351,7 +351,7 @@ private function findLanguageFiles($language)
/**
* Returns the template files.
*
* @return Finder|SplFileInfo[]
* @return Finder|SplFileInfo[]|array
*/
private function findTemplateFiles()
{
Expand Down
36 changes: 20 additions & 16 deletions src/Command/SymlinksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,22 +258,26 @@ private function filterNestedPaths(Finder $finder, $prepend)
foreach ($files as $key => $file) {
$path = rtrim(strtr($prepend.'/'.$file->getRelativePath(), '\\', '/'), '/');

$chunks = explode('/', $path);
array_pop($chunks);

$parent = implode('/', $chunks);

if (in_array($parent, $parents)) {
$this->rows[] = [
sprintf(
'<fg=yellow;options=bold>%s</>',
'\\' === DIRECTORY_SEPARATOR ? 'WARNING' : '!'
),
$this->webDir.'/'.$path,
sprintf('<comment>Skipped because %s will be symlinked.</comment>', $parent),
];

unset($files[$key]);
if (!empty($parents)) {
$parent = dirname($path);

while (false !== strpos($parent, '/')) {
if (in_array($parent, $parents)) {
$this->rows[] = [
sprintf(
'<fg=yellow;options=bold>%s</>',
'\\' === DIRECTORY_SEPARATOR ? 'WARNING' : '!'
),
$this->webDir.'/'.$path,
sprintf('<comment>Skipped because %s will be symlinked.</comment>', $parent),
];

unset($files[$key]);
break;
}

$parent = dirname($parent);
}
}

$parents[] = $path;
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getConfigTreeBuilder()
->validate()
->ifTrue(function ($v) {
return preg_match(
'@^(app|assets|contao|plugins|share|system|templates|vendor|web)(/|$)@',
'@^(app|assets|bin|contao|plugins|share|system|templates|var|vendor|web)(/|$)@',
$v
);
})
Expand Down
48 changes: 48 additions & 0 deletions src/Resources/contao/classes/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,54 @@ public static function addFilesBreadcrumb($strKey='tl_files_node')
}


/**
* Convert an array of layout section IDs to an associative array with IDs and labels
*
* @param array $arrSections
*
* @return array
*/
public static function convertLayoutSectionIdsToAssociativeArray($arrSections)
{
$arrSections = array_flip(array_values(array_unique($arrSections)));

foreach (array_keys($arrSections) as $k)
{
$arrSections[$k] = $GLOBALS['TL_LANG']['COLS'][$k];
}

asort($arrSections);

return $arrSections;
}


/**
* Add the custom layout section references
*/
public function addCustomLayoutSectionReferences()
{
$objLayout = $this->Database->getInstance()->query("SELECT sections FROM tl_layout WHERE sections!=''");

while ($objLayout->next())
{
$arrCustom = \StringUtil::deserialize($objLayout->sections);

// Add the custom layout sections
if (!empty($arrCustom) && is_array($arrCustom))
{
foreach ($arrCustom as $v)
{
if (!empty($v['id']))
{
$GLOBALS['TL_LANG']['COLS'][$v['id']] = $v['title'];
}
}
}
}
}


/**
* Get all allowed pages and return them as string
*
Expand Down
14 changes: 11 additions & 3 deletions src/Resources/contao/classes/DataContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,18 +389,26 @@ protected function row($strPalette=null)
switch ($rgxp)
{
case 'datim':
$time = ",\n timePicker:true";
$time = ",\n timePicker: true";
break;

case 'time':
$time = ",\n pickOnly:\"time\"";
$time = ",\n pickOnly: \"time\"";
break;

default:
$time = '';
break;
}

$strOnSelect = '';

// Trigger the auto-submit function (see #8603)
if ($arrData['eval']['submitOnChange'])
{
$strOnSelect = ",\n onSelect: function() { Backend.autoSubmit(\"" . $this->strTable . "\"); }";
}

$wizard .= ' ' . \Image::getHtml('assets/datepicker/images/icon.svg', '', 'title="'.\StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['datepicker']).'" id="toggle_' . $objWidget->id . '" style="cursor:pointer"') . '
<script>
window.addEvent("domready", function() {
Expand All @@ -410,7 +418,7 @@ protected function row($strPalette=null)
format: "' . $format . '",
positionOffset: {x:-211,y:-209}' . $time . ',
pickerClass: "datepicker_bootstrap",
useFadeInOut: !Browser.ie,
useFadeInOut: !Browser.ie' . $strOnSelect . ',
startDay: ' . $GLOBALS['TL_LANG']['MSC']['weekOffset'] . ',
titleFormat: "' . $GLOBALS['TL_LANG']['MSC']['titleFormat'] . '"
});
Expand Down
13 changes: 8 additions & 5 deletions src/Resources/contao/classes/Frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,10 @@ public static function getRootPageFromUrl()

static::redirect($strUrl, 301);
}
else
elseif (($objPage = \PageModel::findFirstPublishedByPid($objRootPage->id)) !== null)
{
$objPage = \PageModel::findFirstPublishedByPid($objRootPage->id);

// Redirect if it is not the language fall back page and the alias is "index" (see #8498)
if ($objPage !== null && (!$objRootPage->fallback || $objPage->alias != 'index'))
// Redirect if the page is not the language fall back or the alias is not "index" or "/" (see #8498 and #8560)
if (!$objRootPage->fallback || !in_array($objPage->alias, array('index', '/')))
{
static::redirect($objPage->getFrontendUrl(), 302);
}
Expand Down Expand Up @@ -563,6 +561,11 @@ protected function getLoginStatus($strCookie)
*/
public static function getMetaData($strData, $strLanguage)
{
if (empty($strLanguage))
{
return array();
}

$arrData = \StringUtil::deserialize($strData);

// Convert the language to a locale (see #5678)
Expand Down
Loading