Issues (608)

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

1
<?php
2
3
namespace XoopsModules\Oledrion;
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
 * oledrion
17
 *
18
 * @copyright   {@link https://xoops.org/ XOOPS Project}
19
 * @license     {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
20
 * @author      Hervé Thouzard (http://www.herve-thouzard.com/)
21
 */
22
23
/**
24
 * Internal class whose purpose is to pass parameters to the Shelf class
25
 */
26
27
use XoopsModules\Oledrion;
28
29
// defined('XOOPS_ROOT_PATH') || die('Restricted access');
30
31
/**
32
 * Utilisé comme paramètre dans la façcade Shelf
33
 */
34
class ShelfParameters
35
{
36
    /**
37
     * Le conteneur de paramètres
38
     *
39
     * @var array
40
     */
41
    private $parameters = [];
42
43
    /**
44
     * ShelfParameters constructor.
45
     */
46
    public function __construct()
47
    {
48
        $this->resetDefaultValues();
49
    }
50
51
    /**
52
     * Réinitialisation des valeurs
53
     *
54
     * @return ShelfParameters
55
     */
56
    public function resetDefaultValues()
57
    {
58
        $this->parameters['start']               = 0;
59
        $this->parameters['limit']               = 0;
60
        $this->parameters['category']            = 0;
61
        $this->parameters['sort']                = 'product_submitted DESC, product_title';
62
        $this->parameters['order']               = 'ASC';
63
        $this->parameters['excluded']            = 0;
64
        $this->parameters['withXoopsUser']       = false;
65
        $this->parameters['withRelatedProducts'] = false;
66
        $this->parameters['withQuantity']        = false;
67
        $this->parameters['thisMonthOnly']       = false;
68
        $this->parameters['productsType']        = '';
69
70
        return $this;
71
    }
72
73
    /**
74
     * Retourne le tableau des paramètres
75
     *
76
     * @return array
77
     */
78
    public function getParameters()
79
    {
80
        return $this->parameters;
81
    }
82
83
    /**
84
     * Positione la valeur de début
85
     *
86
     * @param int $value
87
     * @return ShelfParameters
88
     */
89
    public function setStart($value)
90
    {
91
        $this->parameters['start'] = (int)$value;
92
93
        return $this;
94
    }
95
96
    /**
97
     * Fixe le nombre maximum d'enregistrements à retourner
98
     *
99
     * @param int $value
100
     * @return ShelfParameters
101
     */
102
    public function setLimit($value)
103
    {
104
        $this->parameters['limit'] = (int)$value;
105
106
        return $this;
107
    }
108
109
    /**
110
     * Fixe la catégorie à utiliser
111
     *
112
     * @param int $value
113
     * @return ShelfParameters
114
     */
115
    public function setCategory($value)
116
    {
117
        $this->parameters['category'] = $value;
118
119
        return $this;
120
    }
121
122
    /**
123
     * Fixe la zone qui sert de tri
124
     *
125
     * @param  string $value
126
     * @return ShelfParameters
127
     */
128
    public function setSort($value)
129
    {
130
        $this->parameters['sort'] = $value;
131
132
        return $this;
133
    }
134
135
    /**
136
     * Fixe l'ordre de tri
137
     *
138
     * @param  string $value
139
     * @return \XoopsModules\Oledrion\ShelfParameters
140
     */
141
    public function setOrder($value)
142
    {
143
        $this->parameters['order'] = $value;
144
145
        return $this;
146
    }
147
148
    /**
149
     * Set the list of products to exclude
150
     *
151
     * @param  mixed $value
152
     * @return string
153
     */
154
    public function setExcluded($value)
155
    {
156
        $this->parameters['excluded'] = $value;
157
158
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type XoopsModules\Oledrion\ShelfParameters which is incompatible with the documented return type string.
Loading history...
159
    }
160
161
    /**
162
     * Indique s'il faut retourner les utilisateurs Xoops
163
     *
164
     * @param  bool $value
165
     * @return ShelfParameters
166
     */
167
    public function setWithXoopsUser($value)
168
    {
169
        $this->parameters['withXoopsUser'] = $value;
170
171
        return $this;
172
    }
173
174
    /**
175
     * Indique s'il faut retourner les produits relatifs
176
     *
177
     * @param  bool $value
178
     * @return ShelfParameters
179
     */
180
    public function setWithRelatedProducts($value)
181
    {
182
        $this->parameters['withRelatedProducts'] = $value;
183
184
        return $this;
185
    }
186
187
    /**
188
     * Indique s'il faut retourner les quantités
189
     *
190
     * @param  bool $value
191
     * @return ShelfParameters
192
     */
193
    public function setWithQuantity($value)
194
    {
195
        $this->parameters['withQuantity'] = $value;
196
197
        return $this;
198
    }
199
200
    /**
201
     * Fixe le type de produits à retourner
202
     *
203
     * @param  string $value
204
     * @return ShelfParameters
205
     */
206
    public function setProductsType($value)
207
    {
208
        $this->parameters['productsType'] = $value;
209
210
        return $this;
211
    }
212
213
    /**
214
     * Indique s'il faut retourner seulement les mois
215
     *
216
     * @param  bool $value
217
     * @return ShelfParameters
218
     */
219
    public function setThisMonthOnly($value)
220
    {
221
        $this->parameters['thisMonthOnly'] = $value;
222
223
        return $this;
224
    }
225
}
226