diff --git a/features.export.inc b/features.export.inc index 2594865..0a13fb6 100644 --- a/features.export.inc +++ b/features.export.inc @@ -461,7 +461,13 @@ function features_var_export($var, $prefix = '', $init = TRUE) { $output = "array(\n"; foreach ($var as $key => $value) { // Using normal var_export on the key to ensure correct quoting. - $output .= " " . var_export($key, TRUE) . " => " . features_var_export($value, ' ', FALSE) . ",\n"; + $output .= " " . var_export($key, TRUE) . " => "; + $export = features_var_export($value, ' ', FALSE); + // Determine if the returned string is JSON; if so, wrap in quotes. + if (json_decode($export)) { + $export = "'" . $export . "'"; + } + $output .= $export . ",\n"; } $output .= ')'; }