bug #2417 Compiler - setlocale must be a string (SpacePossum)

This PR was merged into the 1.x branch.

Discussion
----------

Compiler - setlocale must be a string

Following the docs of [setlocale](http://php.net/manual/en/function.setlocale.php) the second argument must be a `string`, `null` or an `array`. Special note about "0" is there as well.

closes https://github.com/twigphp/Twig/issues/2416

Commits
-------

9de41cfe Update Compiler.php
This commit is contained in:
Fabien Potencier
2017-03-08 09:45:58 -08:00
+1 -1
View File
@@ -169,7 +169,7 @@ class Twig_Compiler implements Twig_CompilerInterface
public function repr($value)
{
if (is_int($value) || is_float($value)) {
if (false !== $locale = setlocale(LC_NUMERIC, 0)) {
if (false !== $locale = setlocale(LC_NUMERIC, '0')) {
setlocale(LC_NUMERIC, 'C');
}