[BUGFIX] Change class name hash generation to md5
authorAlexander Schnitzler <alex.schnitzler@typovision.de>
Sat, 13 Oct 2012 14:17:12 +0000 (16:17 +0200)
committerHelmut Hummel <helmut.hummel@typo3.org>
Sat, 13 Oct 2012 16:25:06 +0000 (18:25 +0200)
Releases: 6.0
Fixes: #41951
Change-Id: I571f2731616e6d1701c5fb02809c9f17e9822164
Reviewed-on: http://review.typo3.org/15559
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/extbase/Classes/Object/Container/Container.php
typo3/sysext/extbase/Tests/Unit/Object/Container/ContainerTest.php

index 6fb694b..e9e09cc 100644 (file)
@@ -319,7 +319,7 @@ class Container implements \TYPO3\CMS\Core\SingletonInterface {
         * @return \TYPO3\CMS\Extbase\Object\Container\ClassInfo
         */
        private function getClassInfo($className) {
-               $classNameHash = str_replace('\\', '-', $className);
+               $classNameHash = md5($className);
                $classInfo = $this->getClassInfoCache()->get($classNameHash);
                if (!$classInfo instanceof \TYPO3\CMS\Extbase\Object\Container\ClassInfo) {
                        $classInfo = $this->getClassInfoFactory()->buildClassInfoFromClassName($className);
index b357adf..41655b4 100644 (file)
@@ -180,9 +180,9 @@ class ContainerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
        /**
         * @test
         */
-       public function getInstanceUsesClassNameSha1AsCacheKey() {
+       public function getInstanceUsesClassNameMd5AsCacheKey() {
                $className = 'TYPO3\\CMS\\Extbase\\Tests\\Unit\\Object\\Container\\Fixtures\\NamespacedClass';
-               $classNameHash = sha1($className);
+               $classNameHash = md5($className);
                $mockedCache = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\Container\\ClassInfoCache', array('has', 'set', 'get'));
                $container = $this->getMock('TYPO3\\CMS\\Extbase\\Object\\Container\\Container', array('log', 'getClassInfoCache'));
                $container->expects($this->any())->method('getClassInfoCache')->will($this->returnValue($mockedCache));