Fixed #1161 PluginAPI::readYAML() and PluginAPI::writeYAML()

This commit is contained in:
Shoghi Cervantes 2014-02-03 19:13:39 +01:00
parent 34378b5776
commit 6325a2298e

View File

@ -179,11 +179,11 @@ class PluginAPI extends stdClass{
}
public function readYAML($file){
return Spyc::YAMLLoad(file_get_contents($file));
return yaml_parse(preg_replace("#^([ ]*)([a-zA-Z_]{1}[^\:]*)\:#m", "$1\"$2\":", file_get_contents($file)));
}
public function writeYAML($file, $data){
return file_put_contents($file, Spyc::YAMLDump($data));
return file_put_contents($file, yaml_emit($data, YAML_UTF8_ENCODING));
}
public function init(){