Issues (608)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  Header Injection
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

blocks/oledrion_categories.php (6 issues)

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
 * oledrion
14
 *
15
 * @copyright   {@link https://xoops.org/ XOOPS Project}
16
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
17
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
18
 */
19
20
use XoopsModules\Oledrion;
21
22
/**
23
 * Affiche le bloc des catégories en fonction de la catégorie en cours (fonctionne de paire avec les pages du module)
24
 * @param $options
25
 * @return array|bool
26
 */
27
function b_oledrion_category_show($options)
28
{
29
    global $xoTheme;
30
    $block = [];
31
    require_once XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
32
    $xoTheme->addStylesheet(OLEDRION_URL . 'assets/css/oledrion.css');
33
34
    $block['nostock_msg'] = Oledrion\Utility::getModuleOption('nostock_msg');
35
36
    if (0 == (int)$options[0]) {
37
        // Catégories selon la page en cours
38
        $block['block_option'] = 0;
39
        if (!isset($GLOBALS['current_category']) || -1 == $GLOBALS['current_category']) {
40
            return false;
41
        }
42
        $cat_cid = (int)$GLOBALS['current_category'];
43
        require_once XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
44
45
        if ($cat_cid > 0) {
46
            require_once XOOPS_ROOT_PATH . '/class/tree.php';
47
            $tbl_categories = $tblChilds = $tbl_tmp = [];
0 ignored issues
show
The assignment to $tblChilds is dead and can be removed.
Loading history...
The assignment to $tbl_categories is dead and can be removed.
Loading history...
48
            $tbl_categories = $categoryHandler->getAllCategories(new Oledrion\Parameters());
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $categoryHandler does not exist. Did you maybe mean $category?
Loading history...
49
            $mytree         = new Oledrion\XoopsObjectTree($tbl_categories, 'cat_cid', 'cat_pid');
50
            $tblChilds      = $mytree->getAllChild($cat_cid);
51
            //$tblChilds = array_reverse($tblChilds);
52
            foreach ($tblChilds as $item) {
53
                $tbl_tmp[] = "<a href='" . $item->getLink() . "' title='" . Oledrion\Utility::makeHrefTitle($item->getVar('cat_title')) . "'>" . $item->getVar('cat_title') . '</a>';
54
            }
55
            $block['block_categories'] = $tbl_tmp;
56
57
            $category = null;
0 ignored issues
show
The assignment to $category is dead and can be removed.
Loading history...
58
            if ($cat_cid > 0) {
59
                $category = $categoryHandler->get($cat_cid);
60
                if (is_object($category)) {
61
                    $block['block_current_category'] = $category->toArray();
62
                }
63
            }
64
        } else {
65
            // On est à la racine, on n'affiche donc que les catégories mères
66
            $tbl_categories = [];
67
            $criteria       = new \Criteria('cat_pid', 0, '=');
68
            $criteria->setSort('cat_title');
69
            $tbl_categories = $categoryHandler->getObjects($criteria, true);
70
            foreach ($tbl_categories as $item) {
71
                $tbl_tmp[] = "<a href='" . $item->getLink() . "' title='" . Oledrion\Utility::makeHrefTitle($item->getVar('cat_title')) . "'>" . $item->getVar('cat_title') . '</a>';
72
            }
73
            $block['block_categories'] = $tbl_tmp;
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $tbl_tmp seems to be defined by a foreach iteration on line 70. Are you sure the iterator is never empty, otherwise this variable is not defined?
Loading history...
74
        }
75
    } elseif (1 == (int)$options[0]) {
76
        // Affichage classique
77
        $block['block_option'] = 1;
78
        require_once XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
79
        // require_once OLEDRION_PATH . 'class/tree.php';
80
        $tbl_categories = $categoryHandler->getAllCategories(new Oledrion\Parameters());
81
        $mytree         = new Oledrion\XoopsObjectTree($tbl_categories, 'cat_cid', 'cat_pid');
82
        $jump           = OLEDRION_URL . 'category.php?cat_cid=';
83
        $additional     = "onchange='location=\"" . $jump . "\"+this.options[this.selectedIndex].value'";
84
        $cat_cid        = 0;
85
        if (isset($GLOBALS['current_category']) && -1 != $GLOBALS['current_category']) {
86
            $cat_cid = (int)$GLOBALS['current_category'];
87
        }
88
89
        $select0    = $mytree->makeSelectElement('cat_cid', 'cat_title', '-', $cat_cid, false, 0, '', $additional);
90
        $htmlSelect = $select0->render();
91
92
        $block['htmlSelect'] = $htmlSelect;
93
    } else {
94
        // Affichage de toute l'arborescence, dépliée
95
        $block['block_option'] = 2;
96
        $block['liMenu']       = $categoryHandler->getUlMenu('category_title');
97
    }
98
99
    return $block;
100
}
101
102
/**
103
 * @param $options
104
 * @return string
105
 */
106
function b_oledrion_category_edit($options)
107
{
108
    global $xoopsConfig;
109
    require_once XOOPS_ROOT_PATH . '/modules/oledrion/include/common.php';
110
111
    $checkeds              = ['', '', ''];
112
    $checkeds[$options[0]] = 'checked';
113
    $form                  = '';
114
    $form                  .= '<b>'
115
                              . _MB_OLEDRION_TYPE_BLOCK
116
                              . "</b><br><input type='radio' name='options[]' id='options[]' value='0' "
117
                              . $checkeds[0]
118
                              . '>'
119
                              . _MB_OLEDRION_TYPE_BLOCK2
120
                              . "<br><input type='radio' name='options[]' id='options[]' value='1' "
121
                              . $checkeds[1]
122
                              . '>'
123
                              . _MB_OLEDRION_TYPE_BLOCK1
124
                              . "<br><input type='radio' name='options[]' id='options[]' value='2' "
125
                              . $checkeds[2]
126
                              . '>'
127
                              . _MB_OLEDRION_TYPE_BLOCK3
128
                              . '</td></tr>';
129
130
    return $form;
131
}
132
133
/**
134
 * Block on the fly
135
 * @param $options
136
 */
137
function b_oledrion_category_duplicatable($options)
138
{
139
    $options = explode('|', $options);
140
    $block   = b_oledrion_category($options);
0 ignored issues
show
The function b_oledrion_category was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

140
    $block   = /** @scrutinizer ignore-call */ b_oledrion_category($options);
Loading history...
141
142
    $tpl = new \XoopsTpl();
143
    $tpl->assign('block', $block);
144
    $tpl->display('db:oledrion_block_categories.tpl');
145
}
146