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 :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
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 12:53 Go to next message
Atomicrun is currently offline  Atomicrun   Sweden
Messages: 54
Registered: November 2010
Location: Lund
Karma: 0
Member
add to buddy list
ignore all messages by this user
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 18: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
add to buddy list
ignore all messages by this user
I think this makes sense and committed it:
http://sourceforge.net/apps/trac/fudforum/changeset/5356
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
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: Sun Dec 17 12:21:15 EST 2017

Total time taken to generate the page: 0.00702 seconds