[dokuwiki] Re: array_merge fix

  • From: Danny Trommer <dantro@xxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Wed, 11 Jan 2006 15:52:54 +0100

Hi,

This is what css.css outputs as error:

<b>Warning</b>: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #2 is not an array in <b>C:\Program Files\xampp\xampp\htdocs\beastiemuseum\lib\exe\css.php</b> on line <b>52</b><br />
<br />
<b>Warning</b>: array_merge() [<a href='function.array-merge'>function.array-merge</a>]: Argument #1 is not an array in <b>C:\Program Files\xampp\xampp\htdocs\beastiemuseum\lib\exe\css.php</b> on line <b>54</b><br />


The css.php fix as supplied by Chris works since the error does not appear anymore.

Regards,
Danny Trommer

--
The Beastie Museum (BM)
http://www.beastiemuseum.com
Phone : +49 (0) 345 6819402
Mobile : +49 (0) 173 1677313


Chris Smith wrote:

Chris Smith wrote:

Danny Trommer wrote:

Hi,

This relates to the latest devel release.
I figured out a problem DokuWiki has with PHP ver. 5.0.5+.
Due to a bad array_merge code implementation DokuWiki generates warnings in the generated css files.
Just save a shown DokuWiki [Edit] page to your HD and check the sylesheets.


To fix the error array_merge($a, $b); must be array_merge((array)$a, (array)$b); to make sure two arrays get merged by array_merge.

Regards,
Danny Trommer

Hi,

I have had a quick (I may have missed something) look at the code and all array_merges appear to be between arrays. Its more probable that an array has failed to be initialised (quite probably there are no plugin css files or no plugin print css files), in which case I think it would be more sensible to check for isset rather than attempt the merge. Do you have details of the line number and the actual error text?

Chris

Actually, I believe its the tplstyles[$mode] that may be uninitialised. If anyone experiencing this problem would like to replace lib/exe/css.php with the attached file (or contact me to get a copy if it goes missing from this message) to see if it corrects the error. On positive feedback, I'll forward a patch to Andy.


Cheers,

Chris

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

Other related posts: