Issues (964)

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/Files/CreateTableFields.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace XoopsModules\Tdmcreate\Files;
4
5
use XoopsModules\Tdmcreate;
6
use XoopsModules\Tdmcreate\Files;
7
8
/*
9
 You may not change or alter any portion of this comment or credits
10
 of supporting developers from this source code or any supporting source code
11
 which is considered copyrighted (c) material of the original comment or credit authors.
12
13
 This program is distributed in the hope that it will be useful,
14
 but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
 */
17
/**
18
 * tdmcreate module.
19
 *
20
 * @copyright       XOOPS Project (https://xoops.org)
21
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
22
 *
23
 * @since           2.5.0
24
 *
25
 * @author          Txmod Xoops http://www.txmodxoops.org
26
 *
27
 */
28
29
/**
30
 * Class CreateTableFields
31
 */
32
class CreateTableFields extends Files\CreateAbstractClass
33
{
34
    /**
35
     * @public   function constructor
36
     */
37
    public function __construct()
38
    {
39
    }
40
41
    /**
42
     * @static function getInstance
43
     *
44
     * @return bool|\TDMCreateTableFields
0 ignored issues
show
The type TDMCreateTableFields was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
45
     */
46
    public static function getInstance()
47
    {
48
        static $instance = false;
49
        if (!$instance) {
50
            $instance = new self();
51
        }
52
53
        return $instance;
54
    }
55
56
    /**
57
     * @public function getTableTables
58
     *
59
     * @param        $mId
60
     *
61
     * @param string $sort
62
     * @param string $order
63
     * @return mixed
64
     */
65
    public function getTableTables($mId, $sort = 'table_id ASC, table_name', $order = 'ASC')
66
    {
67
        $criteria = new \CriteriaCompo();
68
        $criteria->add(new \Criteria('table_mid', $mId)); // $mId = module Id
69
        $criteria->setSort($sort);
70
        $criteria->setOrder($order);
71
        $tables = Tdmcreate\Helper::getInstance()->getHandler('tables')->getObjects($criteria);
0 ignored issues
show
The method getObjects() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of said class. However, the method does not exist in XoopsRankHandler or XoUserHandler. Are you sure you never get one of those? ( Ignorable by Annotation )

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

71
        $tables = Tdmcreate\Helper::getInstance()->getHandler('tables')->/** @scrutinizer ignore-call */ getObjects($criteria);
Loading history...
72
        unset($criteria);
73
74
        return $tables;
75
    }
76
77
    /**
78
     * @public function getTableFields
79
     *
80
     * @param        $mId
81
     * @param        $tId
82
     *
83
     * @param string $sort
84
     * @param string $order
85
     * @return mixed
86
     */
87
    public function getTableFields($mId, $tId, $sort = 'field_id ASC, field_name', $order = 'ASC')
88
    {
89
        $criteria = new \CriteriaCompo();
90
        $criteria->add(new \Criteria('field_mid', $mId)); // $mId = module Id
91
        $criteria->add(new \Criteria('field_tid', $tId)); // $tId = table Id
92
        $criteria->setSort($sort);
93
        $criteria->setOrder($order);
94
        $fields = Tdmcreate\Helper::getInstance()->getHandler('fields')->getObjects($criteria);
95
        unset($criteria);
96
97
        return $fields;
98
    }
99
100
    /**
101
     * @public function getTableFieldElements
102
     *
103
     * @param        $mId
104
     * @param        $tId
105
     *
106
     * @param string $sort
107
     * @param string $order
108
     * @return mixed
109
     */
110
    public function getTableFieldElements($mId = null, $tId = null, $sort = 'fieldelement_id ASC, fieldelement_name', $order = 'ASC')
111
    {
112
        $criteria = new \CriteriaCompo();
113
        if (null != $mId) {
114
            $criteria->add(new \Criteria('fieldelement_mid', $mId)); // $mId = module Id
115
            $criteria->setSort($sort);
116
            $criteria->setOrder($order);
117
        }
118
        if (null != $tId) {
119
            $criteria->add(new \Criteria('fieldelement_tid', $tId)); // $tId = table Id
120
            $criteria->setSort($sort);
121
            $criteria->setOrder($order);
122
        }
123
        $fieldElements = Tdmcreate\Helper::getInstance()->getHandler('fieldelements')->getObjects($criteria);
124
        unset($criteria);
125
126
        return $fieldElements;
127
    }
128
129
    /**
130
     * @public function getTableMoreFiles
131
     *
132
     * @param        $mId
133
     *
134
     * @param string $sort
135
     * @param string $order
136
     * @return mixed
137
     */
138
    public function getTableMoreFiles($mId, $sort = 'file_id ASC, file_name', $order = 'ASC')
139
    {
140
        $criteria = new \CriteriaCompo();
141
        $criteria->add(new \Criteria('file_mid', $mId)); // $mId = module Id
142
        $criteria->setSort($sort);
143
        $criteria->setOrder($order);
144
        $morefiles = Tdmcreate\Helper::getInstance()->getHandler('morefiles')->getObjects($criteria);
145
        unset($criteria);
146
147
        return $morefiles;
148
    }
149
}
150