Error messages appearing

After running without any issues suddenly getting two error messages at top of all pages. Any idea as to cause and solution please?

Warning: Invalid argument supplied for foreach() in /home/rhovan/public_html/gallery/zp-core/controller.php on line 41

Warning: Cannot modify header information - headers already sent by (output started at /home/rhovan/public_html/gallery/zp-core/controller.php:41) in /home/rhovan/public_html/gallery/index.php on line 12

Comments

  • To add to the above, the problem appears to be related to a server upgrade to PHP 5 overnight by host.

    What is likely to be needed to get the gallery going again please.
  • The quick answer is to turn off the Captcha option. The longer answer is to modify the code in controller.php

    Currently it reads:
    `if (getOption('Use_Captcha')) {

    $d = getOption('last_captcha_purge');

    $expire = time() - 86400;

    if ($d > $expire) {

    chdir(SERVERCACHE . "/");

    $filelist = glob('code_*.png');

    foreach ($filelist as $file) {

    $file = SERVERCACHE . "/" . $file;

    if (filemtime($file) < $expire) {

    unlink($file);

    }

    }

    }

    setOption('last_captcha_purge', time());

    }`

    It needs to say:
    `if (getOption('Use_Captcha')) {

    $d = getOption('last_captcha_purge');

    $expire = time() - 86400;

    if ($d > $expire) {

    chdir(SERVERCACHE . "/");

    $filelist = glob('code_*.png');

    if ($filelist) {

    foreach ($filelist as $file) {

    $file = SERVERCACHE . "/" . $file;

    if (filemtime($file) < $expire) {

    unlink($file);

    }

    }

    }

    }

    setOption('last_captcha_purge', time());

    }`
Sign In or Register to comment.