Zookal / HarrisStreet-ImpEx

Magento n98-magerun module for importing and exporting configuration data. Import supports hierarchical folder structure and of course different environments.
62 stars 14 forks source link

YAML export incorrectly escapes single quotes #14

Open bluec opened 7 years ago

bluec commented 7 years ago

The YAML export escapes single quotes with a \ which is incorrect and causes an error to occur on the import of any such strings.

In YAML, a double quote '' (i.e. 2 singles) is how a single ' quote is escaped.

Suggested resolution in src/HarrisStreet/CoreConfigData/Exporter/Yaml.php change:

return '\'' . addcslashes($value, '\'') . '\'';

to

return sprintf("'%s'", str_replace('\'', '\'\'', $value));