|
@@ -1991,7 +1991,6 @@ class SiteController extends ActionController
|
|
|
*/
|
|
*/
|
|
|
protected function findConfigFileAndContentFor(int $rootUid): array
|
|
protected function findConfigFileAndContentFor(int $rootUid): array
|
|
|
{
|
|
{
|
|
|
-
|
|
|
|
|
$configs_directory = $_ENV['TYPO3_PATH_APP'] . "/config/sites/";
|
|
$configs_directory = $_ENV['TYPO3_PATH_APP'] . "/config/sites/";
|
|
|
$candidates = array_filter(
|
|
$candidates = array_filter(
|
|
|
scandir($configs_directory),
|
|
scandir($configs_directory),
|
|
@@ -2002,10 +2001,14 @@ class SiteController extends ActionController
|
|
|
foreach ($candidates as $subdir) {
|
|
foreach ($candidates as $subdir) {
|
|
|
if (preg_match('/\.*_' . $rootUid . '$/', $subdir)) {
|
|
if (preg_match('/\.*_' . $rootUid . '$/', $subdir)) {
|
|
|
$filename = $configs_directory . $subdir . '/config.yaml';
|
|
$filename = $configs_directory . $subdir . '/config.yaml';
|
|
|
- $yamlConfig = Yaml::parseFile($filename);
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ $yamlConfig = Yaml::parseFile($filename);
|
|
|
|
|
|
|
|
- if ($yamlConfig['rootPageId'] === $rootUid) {
|
|
|
|
|
- return [$filename, $yamlConfig];
|
|
|
|
|
|
|
+ if ($yamlConfig['rootPageId'] === $rootUid) {
|
|
|
|
|
+ return [$filename, $yamlConfig];
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (\Symfony\Component\Yaml\Exception\ParseException $e) {
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2013,9 +2016,13 @@ class SiteController extends ActionController
|
|
|
// it wasn't found the easy way, let's look to each file... :(
|
|
// it wasn't found the easy way, let's look to each file... :(
|
|
|
foreach ($candidates as $subdir) {
|
|
foreach ($candidates as $subdir) {
|
|
|
$filename = $configs_directory . $subdir . '/config.yaml';
|
|
$filename = $configs_directory . $subdir . '/config.yaml';
|
|
|
- $yamlConfig = Yaml::parseFile($filename);
|
|
|
|
|
- if ($yamlConfig['rootPageId'] === $rootUid) {
|
|
|
|
|
- return [$filename, $yamlConfig];
|
|
|
|
|
|
|
+ try {
|
|
|
|
|
+ $yamlConfig = Yaml::parseFile($filename);
|
|
|
|
|
+ if ($yamlConfig['rootPageId'] === $rootUid) {
|
|
|
|
|
+ return [$filename, $yamlConfig];
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (\Symfony\Component\Yaml\Exception\ParseException $e) {
|
|
|
|
|
+ continue;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|