1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-06 06:07:31 +02:00

Version 1.4.1: Improved Custom Fields Data Logic

This commit is contained in:
trendschau
2020-11-07 20:37:48 +01:00
parent 4477b61111
commit 7002309ec0

View File

@@ -391,7 +391,12 @@ class MetaApiController extends ContentController
# check if value is formatted as a list, then transform it into an array
if($arrayFeatureOn)
{
$arrayValues = explode(PHP_EOL . '- ',$valuePair['value']);
# normalize line breaks, php-eol does not work here
$cleanvalue = str_replace(array("\r\n", "\r"), "\n", $valuePair['value']);
$cleanvalue = trim($cleanvalue, "\n");
$arrayValues = explode("\n- ",$cleanvalue);
if(count($arrayValues) > 1)
{
$value = array_map(function($item) { return trim($item, '- '); }, $arrayValues);