mirror of
https://github.com/twigphp/Twig.git
synced 2026-08-31 20:47:28 +00:00
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:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user