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
This commit is contained in:
commit
7d141656ee
1 changed files with 20 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue