Skip to content

Commit

Permalink
[BUGFIX] allow "fixedPostVarsSaveFilePath" outside directory "typo3co…
Browse files Browse the repository at this point in the history
…nf" (#259)

Resolve relative path for configuration "fixedPostVarsSaveFilePath"
  • Loading branch information
websi authored and pixelmatseriks committed Aug 11, 2017
1 parent 9b5de30 commit 9886326
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Classes/Utility/FixedPostVarsConfigurationUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use TYPO3\CMS\Core\Database\DatabaseConnection;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\PathUtility;

/**
* Class FixedPostVarsConfigurationUtility
Expand Down Expand Up @@ -186,8 +187,8 @@ protected function getFixedPagesUids()
*/
protected function canWriteConfiguration($fileLocation)
{
$typo3confFolder = PATH_typo3conf;
return @is_writable($typo3confFolder) && (!file_exists($fileLocation) || @is_writable($fileLocation));
$directoryName = PathUtility::dirname($fileLocation);
return @is_writable($directoryName) && (!file_exists($fileLocation) || @is_writable($fileLocation));
}

/**
Expand All @@ -205,6 +206,6 @@ public function getSaveFilePath()
$filePath = PATH_site . 'typo3conf/realurl_fixedPostVars_conf.php';
}

return $filePath;
return PathUtility::getCanonicalPath($filePath);
}
}

0 comments on commit 9886326

Please sign in to comment.