Skip to content
Snippets Groups Projects
Commit 7d141656 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge branch 'xsendfile_complete_zip_fix' of github.com:riso/owncloud-core...

Merge branch 'xsendfile_complete_zip_fix' of github.com:riso/owncloud-core into riso-xsendfile_complete_zip_fix from pull request #3307

Conflicts:
	lib/helper.php
parents 29c28a45 881e362f
No related branches found
No related tags found
No related merge requests found
......@@ -591,9 +591,26 @@ class OC_Helper {
* remove all files in PHP /oc-noclean temp dir
*/
public static function cleanTmpNoClean() {
$tmpDirNoCleanFile = get_temp_dir() . '/oc-noclean/';
if (file_exists($tmpDirNoCleanFile)) {
self::rmdirr($tmpDirNoCleanFile);
$tmpDirNoCleanName=get_temp_dir() . '/oc-noclean/';
if(file_exists($tmpDirNoCleanName) && is_dir($tmpDirNoCleanName)) {
$files=scandir($tmpDirNoCleanName);
foreach($files as $file) {
$fileName = $tmpDirNoCleanName . $file;
if (!\OC\Files\Filesystem::isIgnoredDir($file) && filemtime($fileName) + 600 < time()) {
unlink($fileName);
}
}
// if oc-noclean is empty delete it
$isTmpDirNoCleanEmpty = true;
$tmpDirNoClean = opendir($tmpDirNoCleanName);
while (false !== ($file = readdir($tmpDirNoClean))) {
if (!\OC\Files\Filesystem::isIgnoredDir($file)) {
$isTmpDirNoCleanEmpty = false;
}
}
if ($isTmpDirNoCleanEmpty) {
rmdir($tmpDirNoCleanName);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment