From: Fabien Potencier Date: Sun, 4 Aug 2013 13:12:06 +0000 (+0200) Subject: replaced usage of md5/sha1 by sha256 X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=9a01db60e8b7552955cfcbef7caf0b24dc3119b4;p=web%2Fkonrad%2Ftwig.git replaced usage of md5/sha1 by sha256 --- diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index d11df2e..09ea4a2 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -270,7 +270,7 @@ class Twig_Environment return $this->templateClasses[$cls]; } - return $this->templateClasses[$cls] = $this->templateClassPrefix.md5($this->getLoader()->getCacheKey($name)).$suffix; + return $this->templateClasses[$cls] = $this->templateClassPrefix.hash('sha256', $this->getLoader()->getCacheKey($name)).$suffix; } /** diff --git a/lib/Twig/Parser.php b/lib/Twig/Parser.php index 958e46b..bebdd9b 100644 --- a/lib/Twig/Parser.php +++ b/lib/Twig/Parser.php @@ -49,7 +49,7 @@ class Twig_Parser implements Twig_ParserInterface public function getVarName() { - return sprintf('__internal_%s', hash('sha1', uniqid(mt_rand(), true), false)); + return sprintf('__internal_%s', hash('sha256', uniqid(mt_rand(), true), false)); } public function getFilename() diff --git a/test/Twig/Tests/Node/ModuleTest.php b/test/Twig/Tests/Node/ModuleTest.php index 7dde513..23c66c6 100644 --- a/test/Twig/Tests/Node/ModuleTest.php +++ b/test/Twig/Tests/Node/ModuleTest.php @@ -65,7 +65,7 @@ class Twig_Tests_Node_ModuleTest extends Twig_Test_NodeTestCase