Fork me on GitHub
Subscribe 2

Ticket #399 (fixed bug)

Notice: Undefined variable: install_lang in install.php

  • Created: 2011-04-15 13:20:16
  • Reported by: daris
  • Assigned to: Franz
  • Milestone: 1.4.6
  • Component: installation
  • Priority: normal

Notice: Undefined variable: install_lang in ...\fluxbb-test\install.php on line 142

I get this, when there is installed more than one language pack and when I change Install language (first form). It looks like forum_unregister_globals function unsets that variable.

edit: You should move this code:

// If we've been passed a default language, use it
$install_lang = isset($_REQUEST['install_lang']) ? trim($_REQUEST['install_lang']) : 'English';

// If such a language pack doesn't exist, or isn't up-to-date enough to translate this page, default to English
if (!file_exists(PUN_ROOT.'lang/'.$install_lang.'/install.php'))
    $install_lang = 'English';

require PUN_ROOT.'lang/'.$install_lang.'/install.php';

if (file_exists(PUN_ROOT.'config.php'))
    // Check to see whether FluxBB is already installed
    include PUN_ROOT.'config.php';

    // If we have the 1.3-legacy constant defined, define the proper 1.4 constant so we don't get an incorrect "need to install" message
    if (defined('FORUM'))
        define('PUN', FORUM);

    // If PUN is defined, config.php is probably valid and thus the software is installed
    if (defined('PUN'))
        exit($lang_install['Already installed']);

// Define PUN because email.php requires it
define('PUN', 1);

// If the cache directory is not specified, we use the default setting
if (!defined('FORUM_CACHE_DIR'))
    define('FORUM_CACHE_DIR', PUN_ROOT.'cache/');

// Make sure we are running at least MIN_PHP_VERSION
if (!function_exists('version_compare') || version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
    exit(sprintf($lang_install['You are running error'], 'PHP', PHP_VERSION, FORUM_VERSION, MIN_PHP_VERSION));

after the line:


to solve this.


Franz 2011-04-20 07:48:58

Commit 60d300b to fluxbb fluxbb-1.4

#399: Move around some code in install.php to prevent forum_unregister_globals() from deleting the wrong variables.

Reported by daris.

Franz 2011-04-20 07:50:35

  • Owner set to Franz.
  • Status changed from open to fixed.

And thanks again. Fixed in 60d300b.