ampt
26.05.2011, 13:41
Hi there,
The IDS_LOG_Email class seems to have a bug in it, where the temporary files do not get removed by the garbage collection routine in isSpamAttempt
Here's the updated code, using DIRECTORY_SEPARATOR fixes the problem:
/*
* loop through all files in the tmp directory and
* delete garbage files
*/
$dir = $this->tmp_path;
$numPrefixChars = strlen($this->file_prefix);
$files = scandir($dir);
foreach ($files as $file) {
if (is_file($dir . DIRECTORY_SEPARATOR . $file)) {
if (substr($file, 0, $numPrefixChars) == $this->file_prefix) {
$lastModified = filemtime($dir . DIRECTORY_SEPARATOR . $file);
if ((
time() - $lastModified) > 3600) {
unlink($dir . DIRECTORY_SEPARATOR . $file);
}
}
}
}
thanks,
ampt
The IDS_LOG_Email class seems to have a bug in it, where the temporary files do not get removed by the garbage collection routine in isSpamAttempt
Here's the updated code, using DIRECTORY_SEPARATOR fixes the problem:
/*
* loop through all files in the tmp directory and
* delete garbage files
*/
$dir = $this->tmp_path;
$numPrefixChars = strlen($this->file_prefix);
$files = scandir($dir);
foreach ($files as $file) {
if (is_file($dir . DIRECTORY_SEPARATOR . $file)) {
if (substr($file, 0, $numPrefixChars) == $this->file_prefix) {
$lastModified = filemtime($dir . DIRECTORY_SEPARATOR . $file);
if ((
time() - $lastModified) > 3600) {
unlink($dir . DIRECTORY_SEPARATOR . $file);
}
}
}
}
thanks,
ampt