Commit d28bb427 authored by Georg Ringer's avatar Georg Ringer Committed by Andreas Fernandez
Browse files

[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: default avatarSusanne Moog <typo3@susannemoog.de>
Tested-by: default avatarSusanne Moog <typo3@susannemoog.de>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
parent f5f3dc91
......@@ -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))));
}
/**
......
......@@ -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'));
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment