Page 1 of 1

lang error with more exact error reporting

Posted: Thu Dec 08, 2011 1:20 pm
by Timbalu
On my way tracking errors with our development version, I found the included lang.inc throw an error of missing $serendipity['lang'] in langfile includement.

Right on top of this file there is:

Code: Select all

if (isset($serendipity['lang']) && !isset($serendipity['languages'][$serendipity['lang']])) {
    $serendipity['lang'] = $serendipity['autolang'];
}
which does not set $serendipity['lang'], as missing a [!].

As far as I can see, passing through without further errors (regarding lang) and having no negative effects to real language set later on, the error can be dropped by using

Code: Select all

if (!isset($serendipity['lang']) && ...
If adding this is OK, I proceed.

Right lang inclusion and set correct lang seems quite complicated though.

(I know, its not really a bug, as it does not error and still sets the right lang later on when silencing error reporting to "Fatal" only.)

Re: lang error with more exact error reporting

Posted: Thu Dec 08, 2011 2:21 pm
by garvinhicking
Hi!

This is correct. The if structure checks if there is a language set, but that language is invalid.

What do you mean changing this would fix, I'm not sure I understand?

Regards,
Garvin

Re: lang error with more exact error reporting

Posted: Thu Dec 08, 2011 3:13 pm
by Timbalu
grrr... forget it, Garvin.
Its just always this damn error reporting to handler thing which fools me. Already defined Constants are handled differently than undefined index $vars etc. So you really have to get all these differences before coding the final errorToException function ...

I knew why I better write mails first... ;-)

Re: lang error with more exact error reporting

Posted: Fri Dec 09, 2011 11:05 am
by garvinhicking
Hi!

I prefer replying here than in emails, so that's okay! :-)

Regards,
Garvin