You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use Spyc for Kirby CMS and have stumbled upon an issue that only occurs if PHP's number locale is set to a locale that uses commas as a decimal separator (like German for example).
Consider the following simple test case:
<?phprequire_once'Spyc.php';
$data = ['key' => 1.23];
// basic example$yaml = Spyc::YAMLDump($data, false, false, true);
echo$yaml; // key: 1.23// switch to a different locale that uses// comma as decimal separatorsetlocale(LC_NUMERIC, 'de_DE');
// Spyc now uses that for the YAML output as well,// even though it shouldn't$yaml = Spyc::YAMLDump($data, false, false, true);
echo$yaml; // key: '1,23'
As you can see, the output of Spyc differs even though the input value (a simple float) is the same.
We made a temporary fix in Kirby, maybe that's of use to you or maybe there's a better solution for this all-together.
The text was updated successfully, but these errors were encountered:
We use Spyc for Kirby CMS and have stumbled upon an issue that only occurs if PHP's number locale is set to a locale that uses commas as a decimal separator (like German for example).
Consider the following simple test case:
As you can see, the output of Spyc differs even though the input value (a simple float) is the same.
We made a temporary fix in Kirby, maybe that's of use to you or maybe there's a better solution for this all-together.
The text was updated successfully, but these errors were encountered: