Member
Member
mandarin   2008-01-08, 14:53
#1

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

Member
Member
mandarin   2008-01-08, 16:46
#2

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.

Member
Member
sbillard   2008-01-09, 01:52
#3

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(&#36;file) < &#36;expire) {

    unlink(&#36;file);

  }

}

}

setOption('last_captcha_purge', time());

}`

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

&#36;d = getOption('last_captcha_purge');

&#36;expire = time() - 86400;

if (&#36;d > &#36;expire) {

chdir(SERVERCACHE . "/");

&#36;filelist = glob('code_*.png');

if (&#36;filelist) {

foreach (&#36;filelist as &#36;file) {

  &#36;file = SERVERCACHE . "/" . &#36;file;

  if (filemtime(&#36;file) < &#36;expire) {

    unlink(&#36;file);

  }

}

}

}

setOption('last_captcha_purge', time());

}`

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.