These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /* |
||
3 | You may not change or alter any portion of this comment or credits |
||
4 | of supporting developers from this source code or any supporting source code |
||
5 | which is considered copyrighted (c) material of the original comment or credit authors. |
||
6 | |||
7 | This program is distributed in the hope that it will be useful, |
||
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
10 | */ |
||
11 | |||
12 | /** |
||
13 | * Contact module |
||
14 | * |
||
15 | * @copyright XOOPS Project (https://xoops.org) |
||
16 | * @license http://www.fsf.org/copyleft/gpl.html GNU public license |
||
17 | * @author Kazumi Ono (aka Onokazu) |
||
18 | * @author Trabis <[email protected]> |
||
19 | * @author Hossein Azizabadi (AKA Voltan) |
||
20 | */ |
||
21 | |||
22 | require_once __DIR__ . '/../../../include/cp_header.php'; |
||
23 | require_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
||
24 | require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
||
25 | global $xoopsModule; |
||
0 ignored issues
–
show
|
|||
26 | |||
27 | $moduleDirName = $GLOBALS['xoopsModule']->getVar('dirname'); |
||
28 | |||
29 | if (false !== ($moduleHelper = Xmf\Module\Helper::getHelper($moduleDirName))) { |
||
0 ignored issues
–
show
This
if statement is empty and can be removed.
This check looks for the bodies of These if (rand(1, 6) > 3) {
//print "Check failed";
} else {
print "Check succeeded";
}
could be turned into if (rand(1, 6) <= 3) {
print "Check succeeded";
}
This is much more concise to read.
Loading history...
|
|||
30 | } else { |
||
31 | $moduleHelper = Xmf\Module\Helper::getHelper('system'); |
||
32 | } |
||
33 | /** @var Xmf\Module\Admin $adminObject */ |
||
34 | $adminObject = Xmf\Module\Admin::getInstance(); |
||
35 | |||
36 | $myts = MyTextSanitizer::getInstance(); |
||
37 | |||
38 | if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof XoopsTpl)) { |
||
0 ignored issues
–
show
The class
XoopsTpl does not exist. Did you forget a USE statement, or did you not list all dependencies?
This error could be the result of: 1. Missing dependenciesPHP Analyzer uses your Are you sure this class is defined by one of your dependencies, or did you maybe
not list a dependency in either the 2. Missing use statementPHP does not complain about undefined classes in if ($x instanceof DoesNotExist) {
// Do something.
}
If you have not tested against this specific condition, such errors might go unnoticed.
Loading history...
|
|||
39 | require_once $GLOBALS['xoops']->path('class/template.php'); |
||
40 | $xoopsTpl = new XoopsTpl(); |
||
41 | } |
||
42 | |||
43 | $pathIcon16 = Xmf\Module\Admin::iconUrl('', 16); |
||
44 | $pathIcon32 = Xmf\Module\Admin::iconUrl('', 32); |
||
45 | $pathModIcon32 = $moduleHelper->getConfig('modicons32'); |
||
46 | |||
47 | // Local icons path |
||
48 | $xoopsTpl->assign('pathModIcon16', $pathIcon16); |
||
49 | $xoopsTpl->assign('pathModIcon32', $pathIcon32); |
||
50 | |||
51 | // Load language files |
||
52 | $moduleHelper->loadLanguage('admin'); |
||
53 | $moduleHelper->loadLanguage('modinfo'); |
||
54 | $moduleHelper->loadLanguage('main'); |
||
55 | |||
56 | |||
57 | // Contact Handler |
||
58 | /** @var ContactContactHandler $contactHandler*/ |
||
59 | $contactHandler = xoops_getModuleHandler('contact', $moduleDirName); |
||
60 |
Instead of relying on
global
state, we recommend one of these alternatives:1. Pass all data via parameters
2. Create a class that maintains your state