Pages (3): 1 2 3   
Member
Member
sepkort   19-12-2007, 23:22
#1

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.

Member
Member
sbillard   19-12-2007, 23:42
#2

This is possibly because your zp-config.php file is missing the $conf['allowed_tags'] = array ( array. Or, if you have installed the nightly build you may not have run the setup.php program.

Member
Member
sepkort   20-12-2007, 00:15
#3

Try to add a comment in demo-gallery http://www.zenphoto.org/zenphoto/demo-gallery/ and you'll see the error message.

Member
Member
sbillard   20-12-2007, 00:35
#4

Comments are working perfectly on my site. It is quite possible that the zenphoto demo gallery also is missing the allowed_tags. Did you check yours?

Member
Member
Schnouki   20-12-2007, 03:49
#5

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?

Member
Member
sepkort   20-12-2007, 23:24
#6

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...

Member
Member
sbillard   21-12-2007, 00:49
#7

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

Member
Member
sepkort   22-12-2007, 01:02
#8

I run setup.php on the nightly build and have no problem any more. Thanks!

Member
Member
Elgar   22-12-2007, 22:43
#9

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.

Member
Member
Elgar   22-12-2007, 22:44
#10

I'd better add that I only get the same error as above if I comment out the header redirect, else I get multiple comment entries.

Member
Member
sbillard   22-12-2007, 22:54
#11

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.

Member
Member
Elgar   22-12-2007, 23:14
#12

No errors.

I'll turn comments back on so you can look.

http://elgarl.acemulator.com

Member
Member
sbillard   22-12-2007, 23:41
#13

OK, you can turn them off now. I got 54 repeats.

For some reason, the POST information is not cleared by the redirect. You can try adding unset($_POST); just before the header statement. It is only a guess, though.

Member
Member
Elgar   23-12-2007, 00:01
#14

I'm afraid

unset($_POST);

did nothing when placed right before

header('Location: ' . $redirectTo);

Member
Member
sbillard   23-12-2007, 00:31
#15

Sorry, then, I am out of ideas.

Member
Member
gregb34   23-12-2007, 18:54
#16

i got the same problem ...

Member
Member
gregb34   23-12-2007, 19:00
#17

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.

Member
Member
sbillard   23-12-2007, 19:19
#18

gregb34:

Please see my posting above regarding the allowed_tags array.

Member
Member
gregb34   23-12-2007, 21:46
#19

I have installed the nighty buildand everything it's ok. THANKS !!!

Member
Member
Elgar   24-12-2007, 10:57
#20

No fix here. I've also noted that adding tags and descriptions does nothing.

Pages (3): 1 2 3   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.