Hello,

I am experiencing the captcha bug in the captcha_cron function that I saw referred to in the patch section. The captch module code is not accounting for the fact that there might not be any files to delete, so you get this error:

warning: Invalid argument supplied for foreach() in /[path_removed]/modules/captcha.module on line 28.

I'm getting this error emaied to me once an hour, so it's a bit annoying. :-) I see that someone has uploaded a patch that fixes this error, but I can't seem to figure out how to obtain it. Can someone either a) tell me how I can get the patch, or b) tell me how I can change this code myself to get rid of the error:

function captcha_cron() {
  //Clean up old images
  foreach (glob(variable_get("captcha_image_path", "")."/captcha*.png") as $filename) {
    unlink($filename);
  }
}

Thanks,
Dan Read

Comments

arnabdotorg’s picture

Changes made to CVS / 4.5, please checkout / download from drupal.org itself.