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
Return to the default flat view Create a new topic Submit Reply
php-error-log undefined lang on line 33 [message #165895] Sat, 20 August 2011 16:53 Go to previous message
Atomicrun is currently offline  Atomicrun   Sweden
Messages: 54
Registered: November 2010
Location: Lund
Karma:
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.

[Message index]
 
Read Message
Read Message
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 Nov 23 18:57:03 GMT 2024

Total time taken to generate the page: 0.11972 seconds