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.

class/XoopsObjectTree.php (1 issue)

1
<?php
2
3
namespace XoopsModules\Oledrion;
4
5
/**
6
 * XOOPS tree class
7
 *
8
 * You may not change or alter any portion of this comment or credits
9
 * of supporting developers from this source code or any supporting source code
10
 * which is considered copyrighted (c) material of the original comment or credit authors.
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 *
15
 * @copyright       (c) 2000-2016 XOOPS Project (www.xoops.org)
16
 * @license             GNU GPL 2 (http://www.gnu.org/licenses/gpl-2.0.html)
17
 * @since               2.0.0
18
 * @author              Kazumi Ono (http://www.myweb.ne.jp/, http://jp.xoops.org/)
19
 */
20
defined('XOOPS_ROOT_PATH') || die('Restricted access');
21
22
require_once dirname(dirname(dirname(__DIR__))) . '/class/tree.php';
23
24
/**
25
 * A tree structures with {@link XoopsObject}s as nodes
26
 *
27
 * @author           Kazumi Ono     <[email protected]>
28
 */
29
class XoopsObjectTree extends \XoopsObjectTree
30
{
31
    /**
32
     * @param mixed      $objectArr
33
     * @param mixed      $myId
34
     * @param mixed      $parentId
35
     * @param null|mixed $rootId
36
     */
37
    //    protected $parentId;
38
    //    protected $myId;
39
    //    protected $rootId;
40
    //    protected $tree = [];
41
    //    protected $objects;
42
43
    /**
44
     * Constructor
45
     *
46
     * @param array  $objectArr Array of {@link XoopsObject}s
47
     * @param string $myId      field name of object ID
48
     * @param string $parentId  field name of parent object ID
49
     * @param string $rootId    field name of root object ID
50
     */
51
    public function __construct($objectArr, $myId, $parentId, $rootId = null)
52
    {
53
        parent::__construct($objectArr, $myId, $parentId, $rootId);
54
    }
55
56
    /**
57
     * Make a select box with options from the tree
58
     *
59
     * @param  string      $name           Name of the select box
60
     * @param  string      $fieldName      Name of the member variable from the
61
     *                                     node objects that should be used as the title for the options.
62
     * @param  string      $prefix         String to indent deeper levels
63
     * @param  string      $selected       Value to display as selected
64
     * @param  bool|string $addEmptyOption Set TRUE to add an empty option with value "0" at the top of the hierarchy
65
     * @param int          $key            ID of the object to display as the root of select options
66
     * @param  string      $additional
67
     * @return string      HTML select box
68
     *
69
     * @deprecated since 2.5.9, please use makeSelectElement()
70
     */
71
    public function makeSelBox(
72
        $name,
73
        $fieldName,
74
        $prefix = '-',
75
        $selected = '',
76
        $addEmptyOption = '',
77
        $key = 0,
78
        $additional = '')
79
    {
80
        $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
81
        trigger_error("makeSelBox() is deprecated since 2.5.9, please use makeSelectElement(), accessed from {$trace[0]['file']} line {$trace[0]['line']},");
82
83
        $ret2 = '<select name="' . $name . '" id="' . $name . '" ' . $additional . '>'; //mb needs to test
84
        if (false !== (bool)$addEmptyOption) {
85
            $ret2 .= '<option value="0"></option>';
86
        }
87
88
        $ret = "<select id='" . $name . "' name='" . $name . "'";
89
        if ('' !== $additional) {
90
            $ret .= $additional;
91
        }
92
        $ret .= '>';
93
        if ('' !== $addEmptyOption) {
94
            $tmpSelected = '';
95
            if (0 == $selected) {
96
                $tmpSelected = ' selected';
97
            }
98
            $ret .= '<option' . $tmpSelected . ' value="0">' . $addEmptyOption . '</option>';
99
        }
100
101
        $this->makeSelBoxOptions($fieldName, $selected, $key, $ret, $prefix);
102
103
        return $ret . '</select>';
104
    }
105
106
    /**
107
     * Magic __get method
108
     *
109
     * Some modules did not respect the leading underscore is private convention and broke
110
     * when code was modernized. This will keep them running for now.
111
     *
112
     * @param string $name  unknown variable name requested
113
     *                      currently only '_tree' is supported
114
     *
115
     * @return mixed value
116
     */
117
    public function __get($name)
118
    {
119
        $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
120
        if ('_tree' === $name) {
121
            trigger_error("XoopsObjectTree::\$_tree is deprecated, accessed from {$trace[0]['file']} line {$trace[0]['line']},");
122
123
            return $this->tree;
124
        }
125
        trigger_error('Undefined property: XoopsObjectTree::$' . $name . " in {$trace[0]['file']} line {$trace[0]['line']}, ", E_USER_NOTICE);
126
127
        return null;
128
    }
129
130
    /**
131
     * Internal function used by makeTreeAsArray
132
     * @param        $fieldName
133
     * @param        $key
134
     * @param        $ret
135
     * @param        $prefix_orig
136
     * @param string $prefix_curr
137
     */
138
    public function _recursiveMakeTreeAsArray($fieldName, $key, &$ret, $prefix_orig, $prefix_curr = '')
139
    {
140
        if ($key > 0) {
141
            $value       = $this->tree[$key]['obj']->getVar($this->myId);
142
            $ret[$value] = $prefix_curr . $this->tree[$key]['obj']->getVar($fieldName);
143
            $prefix_curr .= $prefix_orig;
144
        }
145
        if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
146
            foreach ($this->tree[$key]['child'] as $childkey) {
147
                $this->_recursiveMakeTreeAsArray($fieldName, $childkey, $ret, $prefix_orig, $prefix_curr);
148
            }
149
        }
150
    }
151
152
    /**
153
     * Identical function as makeSelBox but returns an array
154
     *
155
     * @param  string $fieldName Name of the member variable from the node objects that should be used as the title for the options.
156
     * @param  string $prefix    String to indent deeper levels
157
     * @param int     $key       ID of the object to display as the root of select options
158
     * @param  null   $empty
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $empty is correct as it would always require null to be passed?
Loading history...
159
     * @return array   key = object ID, value = $fieldName
160
     */
161
    public function makeTreeAsArray($fieldName, $prefix = '-', $key = 0, $empty = null)
162
    {
163
        $ret = [];
164
        if (null !== $empty) {
165
            $ret[0] = $empty;
166
        }
167
        $this->_recursiveMakeTreeAsArray($fieldName, $key, $ret, $prefix);
168
169
        return $ret;
170
    }
171
}
172