FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Bug Reports » php-error-log undefined lang on line 33 (theme_router.plugin 1.0)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
php-error-log undefined lang on line 33 [message #165895] Sat, 20 August 2011 16:53 Go to next message
Atomicrun is currently offline  Atomicrun   Sweden
Messages: 54
Registered: November 2010
Location: Lund
Karma: 0
Member
It go like this, function plugin_theme_router( $usr) the first function, use a variable $lang

if ( isset( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE'])) 
{
   $lang  = substr( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE'], 0, 2);
}
if ( isset( $themes[ $lang])) 
{
   $theme = $themes[ $lang];
}


The result is OK; when $lang is undefined isset( $themes[ $lang]) is still false, but the undefined $lang put an error-line in the php-error-log.

if ( isset( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE'])) 
{
   $lang  = substr( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE'], 0, 2);
   if ( isset( $themes[ $lang])) 
   {
      $theme = $themes[ $lang];
   }
}


The $theme have an OK default value, so a modification occur only if all is OK.

Aw: php-error-log undefined lang on line 33 [message #165897 is a reply to message #165895] Sat, 20 August 2011 22:41 Go to previous message
JanRei is currently offline  JanRei   Germany
Messages: 361
Registered: October 2005
Location: Germany
Karma: 0
Senior Member
Contributing Core Developer
Translator
I think this makes sense and committed it:
http://sourceforge.net/apps/trac/fudforum/changeset/5356
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: error [Delete ALL messages by this user] (FUDforum 3.0.2)
Next Topic: A little Warning is detected in a server log file
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Dec 21 17:15:19 GMT 2024

Total time taken to generate the page: 0.02795 seconds