Issues (51)

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/Tree.php (5 issues)

1
<?php
2
3
namespace XoopsModules\About;
4
5
6
7
require_once XOOPS_ROOT_PATH . '/class/tree.php';
8
9
if (!\class_exists('About\Tree')) {
10
    /**
11
     * Class Tree
12
     */
13
    class Tree extends \XoopsObjectTree
14
    {
15
        /**
16
         * Tree constructor.
17
         * @param array $objectArr
18
         * @param null  $rootId
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $rootId is correct as it would always require null to be passed?
Loading history...
19
         */
20
        public function __construct($objectArr, $rootId = null)
21
        {
22
            parent::__construct($objectArr, 'page_id', 'page_pid', $rootId);
23
        }
24
25
        /**
26
         * @param            $key
27
         * @param            $ret
28
         * @param            $prefix_orig
29
         * @param string     $prefix_curr
30
         * @param null|array $tags
31
         */
32
        public function makeTreeItems($key, &$ret, $prefix_orig, $prefix_curr = '', $tags = null)
33
        {
34
            if ($key > 0) {
35
                if ($tags && \is_array($tags)) {
36
                    foreach ($tags as $tag) {
37
                        $ret[$key][$tag] = $this->tree[$key]['obj']->getVar($tag);
38
                    }
39
                } else {
40
                    $ret[$key]['page_title'] = $this->tree[$key]['obj']->getVar('page_title');
41
                }
42
                $ret[$key]['prefix'] = $prefix_curr;
43
                $prefix_curr         .= $prefix_orig;
44
            }
45
            if (isset($this->tree[$key]['child']) && !empty($this->tree[$key]['child'])) {
46
                foreach ($this->tree[$key]['child'] as $childkey) {
47
                    $this->makeTreeItems($childkey, $ret, $prefix_orig, $prefix_curr, $tags);
48
                }
49
            }
50
        }
51
52
        /**
53
         * @param string $prefix
54
         * @param int    $key
55
         * @param null   $tags
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $tags is correct as it would always require null to be passed?
Loading history...
56
         * @return array
57
         */
58
        public function &makeTree($prefix = '-', $key = 0, $tags = null)
59
        {
60
            $ret = [];
61
            $this->makeTreeItems($key, $ret, $prefix, '', $tags);
62
63
            return $ret;
64
        }
65
66
        /**
67
         * @param string $name
68
         * @param string $fieldName
69
         * @param string $prefix
70
         * @param string $selected
71
         * @param bool   $addEmptyOption
72
         * @param int    $key
73
         * @param string $extra
74
         * @return string
75
         */
76
        public function makeSelBox(
77
            $name,
78
            $fieldName,
79
            $prefix = '-',
80
            $selected = '',
81
            $addEmptyOption = false,
82
            $key = 0,
83
            $extra = ''
84
        ) {
85
            $ret = '<select name=' . $name . '>';
86
            if (!empty($addEmptyOption)) {
87
                $ret .= '<option value="0">' . (\is_string($addEmptyOption) ? $addEmptyOption : '') . '</option>';
0 ignored issues
show
The condition is_string($addEmptyOption) is always false.
Loading history...
88
            }
89
            $this->makeSelBoxOptions('page_title', $selected, $key, $ret, $prefix);
0 ignored issues
show
Deprecated Code introduced by
The function XoopsObjectTree::makeSelBoxOptions() has been deprecated: since 2.5.9, please use makeSelectElement() functionality ( Ignorable by Annotation )

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

89
            /** @scrutinizer ignore-deprecated */ $this->makeSelBoxOptions('page_title', $selected, $key, $ret, $prefix);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
90
            $ret .= '</select>';
91
92
            return $ret;
93
        }
94
95
        /**
96
         * @param       $key
97
         * @param       $ret
98
         * @param array $tags
99
         * @param int   $depth
100
         */
101
        public function getAllChildArray($key, &$ret, $tags = [], $depth = 0)
102
        {
103
            if (0 == --$depth) {
104
                return;
105
            }
106
107
            if (isset($this->tree[$key]['child'])) {
108
                foreach ($this->tree[$key]['child'] as $childkey) {
109
                    if (isset($this->tree[$childkey]['obj'])):
110
                        if ($tags && \is_array($tags)) {
111
                            foreach ($tags as $tag) {
112
                                $ret['child'][$childkey][$tag] = $this->tree[$childkey]['obj']->getVar($tag);
113
                            }
114
                        } else {
115
                            $ret['child'][$childkey]['page_title'] = $this->tree[$childkey]['obj']->getVar('page_title');
116
                        }
117
                    endif;
118
119
                    $this->getAllChildArray($childkey, $ret['child'][$childkey], $tags, $depth);
120
                }
121
            }
122
        }
123
124
        /**
125
         * @param int  $key
126
         * @param null $tags
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $tags is correct as it would always require null to be passed?
Loading history...
127
         * @param int  $depth
128
         * @return array
129
         */
130
        public function makeArrayTree($key = 0, $tags = null, $depth = 0)
131
        {
132
            $ret = [];
133
            if ($depth > 0) {
134
                $depth++;
135
            }
136
            $this->getAllChildArray($key, $ret, $tags, $depth);
137
138
            return $ret;
139
        }
140
    }
141
}
142