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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user