newbbLoadLanguage()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 3
nop 2
dl 0
loc 10
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * NewBB 5.0x,  the forum module for XOOPS project
4
 *
5
 * @copyright      XOOPS Project (https://xoops.org)
6
 * @license        GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
7
 * @author         Taiwen Jiang (phppp or D.J.) <[email protected]>
8
 * @since          4.00
9
 * @package        module::newbb
10
 */
11
12
13
14
defined('NEWBB_FUNCTIONS_INI') || require __DIR__ . '/functions.ini.php';
15
define('NEWBB_FUNCTIONS_LANGUAGE_LOADED', true);
16
17
if (!defined('NEWBB_FUNCTIONS_LANGUAGE')) {
18
    define('NEWBB_FUNCTIONS_LANGUAGE', 1);
19
20
    /**
21
     * @param         $page
22
     * @param string  $dirname
23
     * @return bool
24
     */
25
    function newbbLoadLanguage($page, $dirname = 'newbb')
26
    {
27
        $page = str_replace('..', '', $page);
0 ignored issues
show
Unused Code introduced by
The assignment to $page is dead and can be removed.
Loading history...
28
        if (!@require_once $GLOBALS['xoops']->path("modules/{$dirname}/{$GLOBALS['xoopsConfig']['language']}/{$language}.php")) {
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $language seems to be never defined.
Loading history...
29
            if (!@require_once $GLOBALS['xoops']->path("modules/{$dirname}/language/{$language}.php")) {
30
                return false;
31
            }
32
        }
33
34
        return true;
35
    }
36
}
37