SMF Support > SMF 2.0.x Support

Log Error Messages

(1/1)

justinbowser:
I am getting a few of the following:

Guest
                                                                                                                                                       Today at 07:27:06 PM
                                                                                                                                                       Type of error: General
 
https://bmwr65.org/smf/index.php?scheduled=task;ts=1603839660
2: unlink(/home/bmwrorg/public_html/smf/cache/images/..): Is a directory
File: /home/bmwrorg/public_html/smf/Sources/ScheduledTasks.php
Line: 501

I see in thread https://www.simplemachines.org/community/index.php?topic=571162.0 that this was a bug in January, is there a fix for it or can it be ignored?

Shambles:
If you're happy downloading and editing the ScheduledTasks.php file, you could make the following edit:


--- Code: (find) --- // Cleanup old proxied images.
if (!empty($image_proxy_enabled) && $handle = opendir($cachedir . '/images'))
{
while (false !== ($file = readdir($handle)))
{
// Remove images older than 5 days.
if (filemtime($cachedir . '/images/' . $file) < time() - (5 * 86400))
unlink($cachedir . '/images/' . $file);
}

closedir($handle);
}

--- End code ---



--- Code: (replace with) --- // Cleanup old proxied images.
if (!empty($image_proxy_enabled) && $handle = opendir($cachedir . '/images'))
{
while (false !== ($file = readdir($handle)))
{
// Remove images older than 5 days.
if (!in_array($file, array('..', '.')) &&
filemtime($cachedir . '/images/' . $file) < time() - (5 * 86400))
unlink($cachedir . '/images/' . $file);
}

closedir($handle);
}

--- End code ---

justinbowser:
Shambles - is this a patch to fix the reported bug?

Shambles:
No idea, but it should work.

justinbowser:
I made the code change and we'll see what happens!

Navigation

[0] Message Index

Go to full version