Issues (267)

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/Videos.php (1 issue)

1
<?php
2
3
namespace XoopsModules\Xoopstube;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
 */
14
15
/**
16
 *  Xoopstube class
17
 *
18
 * @copyright       The XUUPS Project https://sourceforge.net/projects/xuups/
19
 * @license         https://www.fsf.org/copyleft/gpl.html GNU public license
20
 * @package         Xoopstube
21
 * @subpackage      Utils
22
 * @since           1.0
23
 * @author          trabis <[email protected]>
24
 */
25
26
use XoopsModules\Xoopstube;
27
use XoopsObject;
28
29
30
/**
31
 * Class Videos
32
 */
33
class Videos extends XoopsObject
34
{
35
    public $dirname;
36
    public $module;
37
    public $handler;
38
    public $config;
39
    public $debug;
40
    public $debugArray = [];
41
42
    /**
43
     * @param $debug
44
     */
45
    protected function __construct($debug)
46
    {
47
        $this->debug   = $debug;
48
        $moduleDirName = \basename(\dirname(__DIR__));
49
        parent::__construct($moduleDirName);
50
    }
51
52
    /**
53
     * @param bool $debug
54
     *
55
     * @return \XoopsModules\Xoopstube\Videos
56
     */
57
    public static function getInstance($debug = false)
58
    {
59
        static $instance;
60
        if (null === $instance) {
61
            $instance = new static($debug);
62
        }
63
        //error_log("istance: [" . print_r($istance,true) . "]");
64
        //phpinfo();
65
        //debug_print_backtrace ();
66
        return $instance;
67
    }
68
69
    public function getModule()
70
    {
71
        if (null === $this->module) {
72
            $this->initModule();
73
        }
74
75
        return $this->module;
76
    }
77
78
    /**
79
     * @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...
80
     * @return mixed|null
81
     */
82
    public function getConfig($name = null)
83
    {
84
        if (null === $this->config) {
85
            $this->initConfig();
86
        }
87
        if (!$name) {
88
            $this->addLog('Getting all config');
89
90
            return $this->config;
91
        }
92
        if (!isset($this->config[$name])) {
93
            $this->addLog("ERROR :: CONFIG '{$name}' does not exist");
94
95
            return null;
96
        }
97
        $this->addLog("Getting config '{$name}' : " . \print_r($this->config[$name], true));
98
99
        return $this->config[$name];
100
    }
101
102
    /**
103
     * @param null|string $name
104
     * @param mixed $value
105
     *
106
     * @return mixed
107
     */
108
    public function setConfig($name = null, $value = null)
109
    {
110
        if (null === $this->config) {
111
            $this->initConfig();
112
        }
113
        $this->config[$name] = $value;
114
        $this->addLog("Setting config '{$name}' : " . $this->config[$name]);
115
116
        return $this->config[$name];
117
    }
118
119
    /**
120
     * @param $name
121
     *
122
     * @return mixed
123
     */
124
    public function getHandler($name)
125
    {
126
        if (!isset($this->handler[$name . 'Handler'])) {
127
            $this->initHandler($name);
128
        }
129
        $this->addLog("Getting handler '{$name}'");
130
131
        return $this->handler[$name . 'Handler'];
132
    }
133
134
    public function initModule()
135
    {
136
        global $xoopsModule;
137
        if (isset($xoopsModule) && \is_object($xoopsModule) && $xoopsModule->getVar('dirname') === $this->dirname) {
138
            $this->module = $xoopsModule;
139
        } else {
140
            /** @var \XoopsModuleHandler $moduleHandler */
141
            $moduleHandler = \xoops_getHandler('module');
142
            $this->module  = $moduleHandler->getByDirname($this->dirname);
143
        }
144
        $this->addLog('INIT MODULE');
145
    }
146
147
    public function initConfig()
148
    {
149
        $this->addLog('INIT CONFIG');
150
        /** @var \XoopsConfigHandler $configHandler */
151
        $configHandler   = \xoops_getHandler('config');
152
        $this->config = $configHandler->getConfigsByCat(0, $this->getModule()->getVar('mid'));
153
    }
154
155
    /**
156
     * @param $name
157
     */
158
    public function initHandler($name)
159
    {
160
        $this->addLog('INIT ' . $name . ' HANDLER');
161
        $this->handler[$name . 'Handler'] = \xoops_getModuleHandler($name, $this->dirname);
162
    }
163
164
    /**
165
     * @param $log
166
     */
167
    public function addLog($log)
168
    {
169
        if ($this->debug && \is_object($GLOBALS['xoopsLogger'])) {
170
            $GLOBALS['xoopsLogger']->addExtra($this->module->name(), $log);
171
        }
172
    }
173
}
174