X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Ftwig%2Ftwig%2Flib%2FTwig%2FCompiler.php;fp=vendor%2Ftwig%2Ftwig%2Flib%2FTwig%2FCompiler.php;h=803eb89625059c988478de96de952a161a34f226;hp=e90bc987d7a27bcc95236ad6373894e9d36f2f84;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/vendor/twig/twig/lib/Twig/Compiler.php b/vendor/twig/twig/lib/Twig/Compiler.php index e90bc987d..803eb8962 100644 --- a/vendor/twig/twig/lib/Twig/Compiler.php +++ b/vendor/twig/twig/lib/Twig/Compiler.php @@ -25,6 +25,7 @@ class Twig_Compiler implements Twig_CompilerInterface protected $sourceOffset; protected $sourceLine; protected $filename; + private $varNameSalt = 0; public function __construct(Twig_Environment $env) { @@ -78,6 +79,7 @@ class Twig_Compiler implements Twig_CompilerInterface // source code starts at 1 (as we then increment it when we encounter new lines) $this->sourceLine = 1; $this->indentation = $indentation; + $this->varNameSalt = 0; if ($node instanceof Twig_Node_Module) { // to be removed in 2.0 @@ -276,7 +278,7 @@ class Twig_Compiler implements Twig_CompilerInterface public function getVarName() { - return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false)); + return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->varNameSalt++)); } }