From 4147fd7949eb6128d5fef7aa1af63808f66748c7 Mon Sep 17 00:00:00 2001
From: Frans Saris <franssaris@gmail.com>
Date: Tue, 24 Mar 2015 19:02:13 +0100
Subject: [PATCH] [BUGFIX] FileList uses wrong basefolder for isWithinFolder

Resolves: #65983
Releases: master, 6.2
Change-Id: I3565ff6e7bae2266ff40f610fca8dc7a6f5beb1c
Reviewed-on: http://review.typo3.org/38125
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
---
 typo3/sysext/filelist/Classes/FileList.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/typo3/sysext/filelist/Classes/FileList.php b/typo3/sysext/filelist/Classes/FileList.php
index c6034b966538..d81ca05cbc57 100644
--- a/typo3/sysext/filelist/Classes/FileList.php
+++ b/typo3/sysext/filelist/Classes/FileList.php
@@ -263,12 +263,12 @@ class FileList extends AbstractRecordList {
 					$addPasteButton = TRUE;
 					foreach ($elFromTable as $element) {
 						$clipBoardElement = $this->resourceFactory->retrieveFileOrFolderObject($element);
-						if ($clipBoardElement instanceof Folder && $this->folderObject->getStorage()->isWithinFolder($clipBoardElement, $folderObject)) {
+						if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $folderObject)) {
 							$addPasteButton = FALSE;
 						}
 					}
 					if ($addPasteButton) {
-						$buttons['PASTE'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $this->folderObject->getCombinedIdentifier())) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $this->path, 'into', $elFromTable)) . '" title="' . $this->getLanguageService()->getLL('clip_paste', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
+						$buttons['PASTE'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('_FILE', $folderObject->getCombinedIdentifier())) . '" onclick="return ' . htmlspecialchars($this->clipObj->confirmMsg('_FILE', $this->path, 'into', $elFromTable)) . '" title="' . $this->getLanguageService()->getLL('clip_paste', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-paste-after') . '</a>';
 					}
 				}
 			}
@@ -397,7 +397,7 @@ class FileList extends AbstractRecordList {
 						$addPasteButton = TRUE;
 						foreach ($elFromTable as $element) {
 							$clipBoardElement = $this->resourceFactory->retrieveFileOrFolderObject($element);
-							if ($clipBoardElement instanceof Folder && $this->folderObject->getStorage()->isWithinFolder($clipBoardElement, $this->folderObject)) {
+							if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $this->folderObject)) {
 								$addPasteButton = FALSE;
 							}
 						}
@@ -838,7 +838,7 @@ class FileList extends AbstractRecordList {
 			$addPasteButton = TRUE;
 			foreach ($elFromTable as $element) {
 				$clipBoardElement = $this->resourceFactory->retrieveFileOrFolderObject($element);
-				if ($clipBoardElement instanceof Folder && $fileOrFolderObject->getStorage()->isWithinFolder($clipBoardElement, $fileOrFolderObject)) {
+				if ($clipBoardElement instanceof Folder && $clipBoardElement->getStorage()->isWithinFolder($clipBoardElement, $fileOrFolderObject)) {
 					$addPasteButton = FALSE;
 				}
 			}
-- 
GitLab