From d28bb4270667999d2b82727cbecb8ba7a7fedb8a Mon Sep 17 00:00:00 2001 From: Georg Ringer Date: Thu, 16 Jul 2015 00:45:32 +0200 Subject: [PATCH] [BUGFIX] Allow symlinked directories in Install Tool If a directory is expected but it is actual a link, check the linked resource. If this is a directory, allow that as well. Change-Id: I85b98a683c987d36a67536050ee595848c7a3b8e Resolves: #57706 Releases: master Reviewed-on: http://review.typo3.org/41383 Reviewed-by: Susanne Moog Tested-by: Susanne Moog Reviewed-by: Andreas Fernandez Tested-by: Andreas Fernandez --- .../sysext/install/Classes/FolderStructure/DirectoryNode.php | 2 +- .../install/Tests/Unit/FolderStructure/DirectoryNodeTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php b/typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php index a1c146606e19..bff025cafe22 100644 --- a/typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php +++ b/typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php @@ -258,7 +258,7 @@ class DirectoryNode extends AbstractNode implements NodeInterface { */ protected function isDirectory() { $path = $this->getAbsolutePath(); - return (!@is_link($path) && @is_dir($path)); + return (@is_dir($path) || (is_link($path) && @is_dir(@readlink($path)))); } /** diff --git a/typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php b/typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php index df8f59871f29..a05726db42bc 100644 --- a/typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php +++ b/typo3/sysext/install/Tests/Unit/FolderStructure/DirectoryNodeTest.php @@ -600,7 +600,7 @@ class DirectoryNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase { /** * @test */ - public function isDirectoryReturnsFalseIfNameIsALinkToADirectory() { + public function isDirectoryReturnsTrueIfNameIsALinkToADirectory() { 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->assertFalse($node->_call('isDirectory')); + $this->assertTrue($node->_call('isDirectory')); } } -- 2.20.1