2010-05-20
michaelgroene
I just qoute the mails from the list:
On 18 May 2010, at 17:09, Michael Gröne wrote:
> > Hello,
> >
> > we are running the newest dokuwiki-release since a while.
> > Yesterday dokuwiki started throwing an error message, when trying to preview a page I would like to create.
> >
> > The error is:
> > substr() expects parameter 1 to be string, array given in <b>/var/www/dokuwiki/doku.php</b> on line <b>67</b>
> >
> > Now I $ACL is filled with $ACL=Array([preview] => Vorschau), so I can understand PHP generating mentioned errormessage.
> >
> > Looking in inc/actions.php there is a function named act_dispatch() which converts the Array to an String.
> > This function is even called in doku.php but _after_ using it in substr() on line 67.
> >
> > My quick and dirty solution is to put act_dispatch in doku.php before line 67, but I don't know whether I mess up other things.
> >
> > Is this a bug in Dokuwiki or can anyone explain this behaviour?
> >
> >
Hi,
Is it an error or a notice/warning?
Did you recently upgrade your PHP?
Turn off "display errors" in your php configuration and turn on "log errors". You should really do that anyway and it stops errors getting in the way of any "header()" calls and creating worse errors.
This particular warning isn't serious and can be ignored. A shortcut to eliminate it is to cast $ACT to string in the substr() call, so "substr((string)$ACT,0,7)". This is a bit of a kludge and relies on the fact that any $ACT arrays will not be exporting. I think that's true. :)
Please also file a bug report at bugs.splitbrain.org. We do try to eliminate these messages to keep the logs clear for important messages.
- Chris
---------------------------
The PHP-Message-Type is "Error".