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.