[dokuwiki] Re: Trouble with php5 and Apache2 in plugin

PHP5 has stricter parameter type checking than PHP4, this is particularly true of the array functions. In PHP4 you could use an undeclared/uninitialised variable as a parameter to an array function without generating a warning. In PHP5, as you've discovered, that is no longer the case.

The solution is to ensure all parameters to these functions are either
- initialised as arrays
- cast as arrays
- not used as arguments in these functions if they aren't arrays.

The files you have listed are core dokuwiki files. If that is actually the case, you should file a bug report.

- Chris

On 26 Apr 2008, at 03:20, Martin Tschofen wrote:
Everything worked fine until I upgraded to Mac Os X 10.5 (running apache 2 and php5).

I'm running the current official release and get a ton of php warnings the first time around a page loads.

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in/Users/martin/Sites/ikamu3/lib/plugins/syntax.phpon line 134

Warning: array_search() [function.array-search]: Wrong datatype for second argument in/Users/martin/Sites/ikamu3/lib/plugins/ syntax.phpon line 137

Warning: in_array() [function.in-array]: Wrong datatype for second argument in/Users/martin/Sites/ikamu3/inc/parser/parser.phpon line 159

The last line repeats itself about a hundred times.

I've upgraded to the latest stable version which is much better but still displays the very first warning on every page the first time around.

Its my plugin that's causing it. I can pull it out and the warnings go away.

Can anybody give me some pointers what I need to look for?

I'd really appreciate it. Thanks...martin

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: