lang error with more exact error reporting

Found a bug? Tell us!!
Post Reply
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

lang error with more exact error reporting

Post 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.)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: lang error with more exact error reporting

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: lang error with more exact error reporting

Post 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... ;-)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: lang error with more exact error reporting

Post by garvinhicking »

Hi!

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

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply