When adding comment Zp Demo Gallery you'll get error the following message:
`Warning: Invalid argument supplied for foreach() in /home/www/zenphoto/zenphoto/zp-core/kses.php on line 429
Warning: Cannot modify header information - headers already sent by (output started at /home/www/zenphoto/zenphoto/zp-core/kses.php:429) in /home/www/zenphoto/zenphoto/zp-core/functions-controller.php on line 164
Warning: Cannot modify header information - headers already sent by (output started at /home/www/zenphoto/zenphoto/zp-core/kses.php:429) in /home/www/zenphoto/zenphoto/zp-core/functions-controller.php on line 169
`
The error is resulted by my demo site (ZP Version 1.1.3) as well as Zp Demo Gallery.
Try to add a comment in demo-gallery http://www.zenphoto.org/zenphoto/demo-gallery/ and you'll see the error message.
There is definitely something weird with this kses.php thing. I had the same problem with a perfectly fine zp-config.php (1&1 host, PHP5, MySQL 5). I tried to debug it and found that the problem has something to do with getOption('allowed_tags') in functions-controller.php. Looks like it doesn't even return an array...
I fixed this bug by adding "$inarray = getOption('allowed_tags');" in kses.php line 428.
I don't get any warning anymore, but I don't think you really can consider this as a fix, it's just a workaround.
Does anybody have an idea about how to solve the real bug?
I installed the latest version: zenPHOTO 1.1.3 12/17/2007 and run the setup. My zp-config.php file includes the following lines:
...
`
$conf['allowed_tags'] = array (
'a' => array ('href' => array (), 'title' => array ()),
'abbr' => array ('title' => array ()),
'acronym' => array ('title' => array ()),
'b' => array (),
'blockquote' => array ('cite' => array ()),
'code' => array (),
'em' => array (),
'i' => array (),
'strike' => array (),
'strong' => array (),
'ul' => array (),
'ol' => array (),
'li' => array (),
);
`
...
The workaround by Schnouki gets the warning message out. The bug is still there...
The following comments refer to the nightly build only, not to the released 1.1.3 version. If you are running the 1.1.3 released version, check you config.php file for the code quoted by sepkort above.
There is a change in how the html tags allowed for comments as processed by kses are handled. There is now an option for these rather than code in zp-config.php.
first: the "fix" by Schnouki is not correct and should not be necessary. getOption('allowed_tags') does not return an array. It returns the option string. That must be parsed by the call on parseAllowedTags which is on the following line.
If you have not run setup.php, the kses allowed_tags option default will not have been set. This should be corrected, but does not seem to cause the errors you are describing.
The only way I have been able to generate the error described above is by manually editing the database option table row for allowed_tags and setting it to something invalid.
So, if you have run setup.php on the nightly build and are still having this problem you will need to delete the allowed_tags option row and re-run setup.php. If this still does not work, add a line below the call on parseAllowedTags in functions-controller as follows:
if ($allowed === false) { $allowed = array(); } // someone has screwed with the allowed_tags option row in the database, but better safe than sorry
I have this same problem (ish).
With the current release AND the nightly build on IIS 5.
If I attempt to add a comment it will add 26 duplicates of the same comment and then redirect to a blank page.
Yes I have run setup.php and I've checked the allowed_tags.
I'd been tracking this problem and had come to the same Kses.php when I came across this post.
Elgar:
Do you get any cgi errors? Kses.php's task is to screen the information posted for html tags. It does not appear to be involved in the redirect.
It is strange that you get 26 duplicates. One would think that if the redirect is causing a repost, nothing would terminate the loop.
How about a link to your site so we can take a look.
I have this error :
Warning: Invalid argument supplied for foreach() in /var/www_data/zenphoto/zp-core/kses.php on line 429
Warning: Cannot modify header information - headers already sent by (output started at /var/www_data/zenphoto/zp-core/kses.php:429) in /var/www_data/zenphoto/zp-core/functions-controller.php on line 164
Warning: Cannot modify header information - headers already sent by (output started at /var/www_data/zenphoto/zp-core/kses.php:429) in /var/www_data/zenphoto/zp-core/functions-controller.php on line 169
But the comment is added.