News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Log Error Messages

Started by justinbowser, October 28, 2020, 12:36:49 AM

Previous topic - Next topic

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) Select

// 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);
}



Code (replace with) Select

// 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);
}


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!

Advertisement: