Issues (807)

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/pedigree.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
 *  PedigreePedigree class
14
 *
15
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
16
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
17
 * @package         Class
18
 * @subpackage      Utils
19
 * @since           1.0
20
 * @author          trabis <[email protected]>
21
 */
22
23
/**
24
 * Class PedigreePedigree
25
 */
26
class PedigreePedigree
27
{
28
    public $dirname;
29
    public $module;
30
    public $handler;
31
    public $config;
32
    public $debug;
33
    public $debugArray = [];
34
35
    /**
36
     * @param $debug
37
     */
38
    protected function __construct($debug)
39
    {
40
        $this->debug   = $debug;
41
        $moduleDirName = \basename(\dirname(__DIR__));
42
        parent::__construct($moduleDirName);
43
    }
44
45
    /**
46
     * @param bool $debug
47
     *
48
     * @return PedigreePedigree
49
     */
50
    public static function getInstance($debug = false)
51
    {
52
        static $instance;
53
        if (null === $instance) {
54
            $instance = new static($debug);
55
        }
56
        //error_log("istance: [" . print_r($istance,true) . "]");
57
        //phpinfo();
58
        //debug_print_backtrace ();
59
        return $instance;
60
    }
61
62
    public function getModule()
63
    {
64
        if (null === $this->module) {
65
            $this->initModule();
66
        }
67
68
        return $this->module;
69
    }
70
71
    /**
72
     * @param null $name
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $name is correct as it would always require null to be passed?
Loading history...
73
     * @return |null
0 ignored issues
show
Documentation Bug introduced by
The doc comment |null at position 0 could not be parsed: Unknown type name '|' at position 0 in |null.
Loading history...
74
     */
75
    public function getConfig($name = null)
76
    {
77
        if (null === $this->config) {
78
            $this->initConfig();
79
        }
80
        if (!$name) {
0 ignored issues
show
$name is of type null, thus it always evaluated to false.
Loading history...
81
            $this->addLog('Getting all config');
82
83
            return $this->config;
84
        }
85
        if (!isset($this->config[$name])) {
86
            $this->addLog("ERROR :: CONFIG '{$name}' does not exist");
87
88
            return null;
89
        }
90
        $this->addLog("Getting config '{$name}' : " . print_r($this->config[$name], true));
91
92
        return $this->config[$name];
93
    }
94
95
    /**
96
     * @param null $name
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $name is correct as it would always require null to be passed?
Loading history...
97
     * @param null $value
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $value is correct as it would always require null to be passed?
Loading history...
98
     *
99
     * @return mixed
100
     */
101
    public function setConfig($name = null, $value = null)
102
    {
103
        if (null === $this->config) {
104
            $this->initConfig();
105
        }
106
        $this->config[$name] = $value;
107
        $this->addLog("Setting config '{$name}' : " . $this->config[$name]);
108
109
        return $this->config[$name];
110
    }
111
112
    /**
113
     * @param $name
114
     *
115
     * @return mixed
116
     */
117
    public function getHandler($name)
118
    {
119
        if (!isset($this->handler[$name . 'Handler'])) {
120
            $this->initHandler($name);
121
        }
122
        $this->addLog("Getting handler '{$name}'");
123
124
        return $this->handler[$name . 'Handler'];
125
    }
126
127
    public function initModule()
128
    {
129
        global $xoopsModule;
130
        if (isset($xoopsModule) && is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $this->dirname) {
131
            $this->module = $xoopsModule;
132
        } else {
133
            /** @var \XoopsModuleHandler $moduleHandler */
134
            $moduleHandler = xoops_getHandler('module');
135
            $this->module  = $moduleHandler->getByDirname($this->dirname);
136
        }
137
        $this->addLog('INIT MODULE');
138
    }
139
140
    public function initConfig()
141
    {
142
        $this->addLog('INIT CONFIG');
143
        $hModConfig   = xoops_getHandler('config');
144
        $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid'));
0 ignored issues
show
The method getConfigsByCat() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

144
        /** @scrutinizer ignore-call */ 
145
        $this->config = $hModConfig->getConfigsByCat(0, $this->getModule()->getVar('mid'));
Loading history...
145
    }
146
147
    /**
148
     * @param $name
149
     */
150
    public function initHandler($name)
151
    {
152
        $this->addLog('INIT ' . $name . ' HANDLER');
153
        $this->handler[$name . 'Handler'] = xoops_getModuleHandler($name, $this->dirname);
154
    }
155
156
    /**
157
     * @param $log
158
     */
159
    public function addLog($log)
160
    {
161
        if ($this->debug) {
162
            if (is_object($GLOBALS['xoopsLogger'])) {
163
                $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log);
164
            }
165
        }
166
    }
167
}
168