This commit is contained in:
Philipp Dieter
2021-11-23 00:00:58 +01:00
9 changed files with 145 additions and 10 deletions

View File

@@ -22,7 +22,11 @@ class ArrayUtility
*/
public static function toObject($array) {
if (is_array($array)) {
return (object) array_map([__CLASS__, __METHOD__], $array);
if (self::isAssoc($array)) {
return (object) array_map([__CLASS__, __METHOD__], $array);
} else {
return array_map([__CLASS__, __METHOD__], $array);
}
} else {
return $array;
}
@@ -46,4 +50,15 @@ class ArrayUtility
return $array;
}
/**
*
*/
public static function isAssoc(array $arr) {
if (array() === $arr) {
return false;
}
return array_keys($arr) !== range(0, count($arr) - 1);
}
}

View File

@@ -280,6 +280,13 @@ class MailUtility
$bodydataText[] = $textRow;
$bodydataHtml[] = $htmlRow;
break;
case 'attachment':
$mail->attach(new \Swift_Attachment(
$row['data'][0],
$row['data'][1],
$row['data'][2]
));
break;
case 'attachmentBase64':
$attachmentdata = explode(',', $row['data']);
preg_match('/\w*:(.*);\w*/', $attachmentdata[0], $matches);

View File

@@ -27,8 +27,10 @@ class SiteConfigUtility
* @var string $path
* @return string
*/
public static function getByPath($path)
{
public static function getByPath(
$path,
$limitToSiteConfig = true
) {
$pathParts = explode('.', $path);
$objectManager = GeneralUtility::makeInstance(
ObjectManager::class
@@ -40,7 +42,10 @@ class SiteConfigUtility
ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT
);
$typoscript = GeneralUtility::removeDotsFromTS($typoscript);
$siteConfig = $typoscript['config']['site'];
$siteConfig = $typoscript;
if ($limitToSiteConfig) {
$siteConfig = $typoscript['config']['site'];
}
$current = &$siteConfig;
foreach ($pathParts as $key) {
$current = &$current[$key];