Issues (519)

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/AddFiles.php (15 issues)

1
<?php namespace XoopsModules\Tdmcreate;
2
3
use XoopsModules\Tdmcreate;
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
 * morefiles class.
17
 *
18
 * @copyright       The XOOPS Project http:sourceforge.net/projects/xoops/
19
 * @license         GNU GPL 2 (http:www.gnu.org/licenses/old-licenses/gpl-2.0.html)
20
 *
21
 * @since           2.5.7
22
 *
23
 * @author          Txmod Xoops <[email protected]> - <http:www.txmodxoops.org/>
24
 *
25
 * @version         $Id: morefiles.php 13080 2015-06-12 10:12:32Z timgno $
26
 */
27
//include __DIR__.'/autoload.php';
28
29
/**
30
 * Class MoreFiles.
31
 */
32
class AddFiles extends \XoopsObject
33
{
34
    /**
35
     * Tdmcreate.
36
     *
37
     * @var mixed
38
     */
39
    private $helper;
40
41
    /**
42
     * Settings.
43
     *
44
     * @var mixed
45
     */
46
    private $settings;
0 ignored issues
show
The private property $settings is not used, and could be removed.
Loading history...
47
48
    /**
49
    *  @public function constructor class
50
    *  @param null
51
    */
52
53
    public function __construct()
54
    {
55
        $this->helper = Tdmcreate\Helper::getInstance();
56
57
        $this->initVar('file_id', XOBJ_DTYPE_INT);
58
        $this->initVar('file_mid', XOBJ_DTYPE_INT);
59
        $this->initVar('file_name', XOBJ_DTYPE_TXTBOX);
60
        $this->initVar('file_extension', XOBJ_DTYPE_TXTBOX);
61
        $this->initVar('file_infolder', XOBJ_DTYPE_TXTBOX);
62
    }
63
64
    /**
65
     * @param string $method
66
     * @param array  $args
67
     *
68
     * @return mixed
69
     */
70
    public function __call($method, $args)
71
    {
72
        $arg = isset($args[0]) ? $args[0] : null;
73
74
        return $this->getVar($method, $arg);
75
    }
76
77
    /**
78
    *  @static function getInstance
79
    *  @param null
80
     * @return AddFiles
81
     */
82
    public static function getInstance()
83
    {
84
        static $instance = false;
85
        if (!$instance) {
86
            $instance = new self();
87
        }
88
89
        return $instance;
90
    }
91
92
    /**
93
    *  @public function getFormMoreFiles
94
    *  @param mixed $action
95
     *
96
     * @return \XoopsThemeForm
97
     */
98
    public function getFormAddFiles($action = false)
99
    {
100
        if (false === $action) {
101
            $action = $_SERVER['REQUEST_URI'];
102
        }
103
104
        $isNew = $this->isNew();
105
        $title = $isNew ? sprintf(_AM_TDMCREATE_ADDFILES_NEW) : sprintf(_AM_TDMCREATE_ADDFILES_EDIT);
0 ignored issues
show
The constant XoopsModules\Tdmcreate\_AM_TDMCREATE_ADDFILES_EDIT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant XoopsModules\Tdmcreate\_AM_TDMCREATE_ADDFILES_NEW was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
106
107
        xoops_load('XoopsFormLoader');
108
109
        $form = new \XoopsThemeForm($title, 'addfilesform', $action, 'post', true);
110
        $form->setExtra('enctype="multipart/form-data"');
111
112
        $modules = $this->helper->getHandler('modules')->getObjects(null);
113
        $modulesSelect = new \XoopsFormSelect(_AM_TDMCREATE_ADDFILES_MODULES, 'file_mid', $this->getVar('file_mid'));
0 ignored issues
show
The constant XoopsModules\Tdmcreate\_...CREATE_ADDFILES_MODULES was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
114
        $modulesSelect->addOption('', _AM_TDMCREATE_ADDFILES_MODULE_SELECT);
0 ignored issues
show
The constant XoopsModules\Tdmcreate\_..._ADDFILES_MODULE_SELECT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
115
        foreach ($modules as $mod) {
116
            $modulesSelect->addOption($mod->getVar('mod_id'), $mod->getVar('mod_name'));
117
        }
118
        $form->addElement($modulesSelect, true);
119
120
        $modName = new \XoopsFormText(_AM_TDMCREATE_ADDFILES_NAME, 'file_name', 50, 255, $this->getVar('file_name'));
0 ignored issues
show
The constant XoopsModules\Tdmcreate\_AM_TDMCREATE_ADDFILES_NAME was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
It seems like $this->getVar('file_name') can also be of type array and array; however, parameter $value of XoopsFormText::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

120
        $modName = new \XoopsFormText(_AM_TDMCREATE_ADDFILES_NAME, 'file_name', 50, 255, /** @scrutinizer ignore-type */ $this->getVar('file_name'));
Loading history...
121
        $modName->setDescription(_AM_TDMCREATE_ADDFILES_NAME_DESC);
0 ignored issues
show
The constant XoopsModules\Tdmcreate\_...EATE_ADDFILES_NAME_DESC was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
122
        $form->addElement($modName, true);
123
124
        $fileEstension = new \XoopsFormText(_AM_TDMCREATE_ADDFILES_EXTENSION, 'file_extension', 50, 255, $this->getVar('file_extension'));
0 ignored issues
show
The constant XoopsModules\Tdmcreate\_...EATE_ADDFILES_EXTENSION was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
125
        $fileEstension->setDescription(_AM_TDMCREATE_ADDFILES_EXTENSION_DESC);
0 ignored issues
show
The constant XoopsModules\Tdmcreate\_...ADDFILES_EXTENSION_DESC was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
126
        $form->addElement($fileEstension, true);
127
128
        $fileInfolder = new \XoopsFormText(_AM_TDMCREATE_ADDFILES_INFOLDER, 'file_infolder', 50, 255, $this->getVar('file_infolder'));
0 ignored issues
show
The constant XoopsModules\Tdmcreate\_...REATE_ADDFILES_INFOLDER was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
129
        $fileInfolder->setDescription(_AM_TDMCREATE_ADDFILES_INFOLDER_DESC);
0 ignored issues
show
The constant XoopsModules\Tdmcreate\_..._ADDFILES_INFOLDER_DESC was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
130
        $form->addElement($fileInfolder, true);
131
132
        $form->addElement(new \XoopsFormHidden('op', 'save'));
133
        $form->addElement(new \XoopsFormButton(_REQUIRED.' <sup class="red bold">*</sup>', 'submit', _SUBMIT, 'submit'));
134
135
        return $form;
136
    }
137
138
    /**
139
     * Get AddFiles Values.
140
     * @param null $keys
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $keys is correct as it would always require null to be passed?
Loading history...
141
     * @param null $format
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $format is correct as it would always require null to be passed?
Loading history...
142
     * @param null $maxDepth
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $maxDepth is correct as it would always require null to be passed?
Loading history...
143
     * @return array
144
     */
145
    public function getAddFilesValues($keys = null, $format = null, $maxDepth = null)
146
    {
147
        $ret = $this->getValues($keys, $format, $maxDepth);
148
        // Values
149
        $ret['id'] = $this->getVar('file_id');
150
        $ret['mid'] = $this->helper->getHandler('modules')->get($this->getVar('file_mid'))->getVar('mod_name');
151
        $ret['name'] = $this->getVar('file_name');
152
        $ret['extension'] = $this->getVar('file_extension');
153
        $ret['infolder'] = $this->getVar('file_infolder');
154
155
        return $ret;
156
    }
157
}
158
159