update debug
All checks were successful
Build, Push, Publish / Build & Release (push) Successful in 27s
All checks were successful
Build, Push, Publish / Build & Release (push) Successful in 27s
This commit is contained in:
65
plugin.php
65
plugin.php
@@ -673,45 +673,46 @@ function icc_upload_and_shorten_local_file_manager($dir, $url)
|
||||
}
|
||||
}
|
||||
|
||||
// Recursive directory removal
|
||||
function icc_rrmdir($dir)
|
||||
{
|
||||
if (is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object != "." && $object != "..") {
|
||||
if (is_dir($dir . "/" . $object) && !is_link($dir . "/" . $object))
|
||||
icc_rrmdir($dir . "/" . $object);
|
||||
else
|
||||
unlink($dir . "/" . $object);
|
||||
}
|
||||
}
|
||||
|
||||
// Recursive directory removal
|
||||
function icc_rrmdir($dir)
|
||||
{
|
||||
if (is_dir($dir)) {
|
||||
$objects = scandir($dir);
|
||||
foreach ($objects as $object) {
|
||||
if ($object != "." && $object != "..") {
|
||||
if (is_dir($dir . "/" . $object) && !is_link($dir . "/" . $object))
|
||||
icc_rrmdir($dir . "/" . $object);
|
||||
else
|
||||
unlink($dir . "/" . $object);
|
||||
}
|
||||
rmdir($dir);
|
||||
}
|
||||
rmdir($dir);
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup Temp Folders
|
||||
function icc_upload_and_shorten_cleanup_temp()
|
||||
{
|
||||
$temp_dir = yourls_get_option('icc_upload_share_dir');
|
||||
if (!$temp_dir)
|
||||
$temp_dir = sys_get_temp_dir();
|
||||
// Cleanup Temp Folders
|
||||
function icc_upload_and_shorten_cleanup_temp()
|
||||
{
|
||||
$temp_dir = yourls_get_option('icc_upload_share_dir');
|
||||
if (!$temp_dir)
|
||||
$temp_dir = sys_get_temp_dir();
|
||||
|
||||
if (!is_dir($temp_dir))
|
||||
return;
|
||||
if (!is_dir($temp_dir))
|
||||
return;
|
||||
|
||||
// Scan for icc_temp_* directories
|
||||
$files = scandir($temp_dir);
|
||||
foreach ($files as $file) {
|
||||
if ($file == '.' || $file == '..')
|
||||
continue;
|
||||
// Scan for icc_temp_* directories
|
||||
$files = scandir($temp_dir);
|
||||
foreach ($files as $file) {
|
||||
if ($file == '.' || $file == '..')
|
||||
continue;
|
||||
|
||||
$path = rtrim($temp_dir, '/') . '/' . $file;
|
||||
if (is_dir($path) && strpos($file, 'icc_temp_') === 0) {
|
||||
// Check age (1 hour = 3600 seconds)
|
||||
if (filemtime($path) < (time() - 86400)) {
|
||||
icc_rrmdir($path);
|
||||
}
|
||||
$path = rtrim($temp_dir, '/') . '/' . $file;
|
||||
if (is_dir($path) && strpos($file, 'icc_temp_') === 0) {
|
||||
// Check age (1 hour = 3600 seconds)
|
||||
if (filemtime($path) < (time() - 86400)) {
|
||||
icc_rrmdir($path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user