Revert "[BUGFIX] Allow symlinked directories in Install Tool" 04/41404/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Thu, 16 Jul 2015 08:53:16 +0000 (10:53 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 16 Jul 2015 09:17:40 +0000 (11:17 +0200)
A link is not a directory.

This reverts commit d28bb4270667999d2b82727cbecb8ba7a7fedb8a.

Change-Id: I0d8d33bae922a94dbb525e1fd575defcfb95074f
Resolves: #57706
Releases: master
Reviewed-on: http://review.typo3.org/41404
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php
typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php

index bff025c..a1c1466 100644 (file)
@@ -258,7 +258,7 @@ class DirectoryNode extends AbstractNode implements NodeInterface {
         */
        protected function isDirectory() {
                $path = $this->getAbsolutePath();
-               return (@is_dir($path) || (is_link($path) && @is_dir(@readlink($path))));
+               return (!@is_link($path) && @is_dir($path));
        }
 
        /**
index a05726d..df8f598 100644 (file)
@@ -600,7 +600,7 @@ class DirectoryNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        /**
         * @test
         */
-       public function isDirectoryReturnsTrueIfNameIsALinkToADirectory() {
+       public function isDirectoryReturnsFalseIfNameIsALinkToADirectory() {
                if (TYPO3_OS === 'WIN') {
                        $this->markTestSkipped('Test not available on Windows OS.');
                }
@@ -614,7 +614,7 @@ class DirectoryNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                mkdir($path . '/' . $dir);
                symlink($path . '/' . $dir, $path . '/' . $link);
                $node->expects($this->any())->method('getAbsolutePath')->will($this->returnValue($path . '/' . $link));
-               $this->assertTrue($node->_call('isDirectory'));
+               $this->assertFalse($node->_call('isDirectory'));
        }
 
 }