diff --git a/typo3/sysext/impexp/Classes/Import.php b/typo3/sysext/impexp/Classes/Import.php
index 0a4db65d08fdef0163775bda46d68a021c879c5a..53750124c1bf6fb4acc7545bfc677f59915b6a54 100644
--- a/typo3/sysext/impexp/Classes/Import.php
+++ b/typo3/sysext/impexp/Classes/Import.php
@@ -957,14 +957,10 @@ class Import extends ImportExport
     public function unlinkTempFiles()
     {
         foreach ($this->unlinkFiles as $fileName) {
-            if (GeneralUtility::isFirstPartOfStr($fileName, Environment::getPublicPath() . '/typo3temp/')) {
-                GeneralUtility::unlink_tempfile($fileName);
-                clearstatcache();
-                if (is_file($fileName)) {
-                    $this->error('Error: ' . $fileName . ' was NOT unlinked as it should have been!');
-                }
-            } else {
-                $this->error('Error: ' . $fileName . ' was not in temp-path. Not removed!');
+            GeneralUtility::unlink_tempfile($fileName);
+            clearstatcache();
+            if (is_file($fileName)) {
+                $this->error('Error: ' . $fileName . ' was NOT unlinked as it should have been!');
             }
         }
         $this->unlinkFiles = [];