cubecart / v6

CubeCart Version 6
https://cubecart.com
73 stars 57 forks source link

Logic Error #3631

Closed bhsmither closed 3 months ago

bhsmither commented 3 months ago

In settings.language.inc.php, lines 165-171, there is:

} else {
    $breadcrumb = $_REQUEST['type'];
    $strings = $GLOBALS['language']->getStrings($type);
    $definitions = $GLOBALS['language']->getDefinitions($_REQUEST['type']);
    $type  = $_REQUEST['type'];
    $custom  = $GLOBALS['language']->getCustom($type, $_GET['language']);
}

Note that getStrings() is using $type before $type is defined.

Suggest:

} else {
    $breadcrumb = $_REQUEST['type'];
    $definitions = $GLOBALS['language']->getDefinitions($_REQUEST['type']);
    $type  = $_REQUEST['type'];
    $strings = $GLOBALS['language']->getStrings($type);
    $custom  = $GLOBALS['language']->getCustom($type, $_GET['language']);
}

And would $GLOBALS['language']->loadDefinitions() need to be called here?

bhsmither commented 3 months ago

But see #3565.

abrookbanks commented 3 months ago

And would $GLOBALS['language']->loadDefinitions() need to be called here?

Not if everything's working as it is.