Issues (201)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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.

includes/Admin/Model/Article.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
namespace Redaxscript\Admin\Model;
3
4
use Redaxscript\Model as BaseModel;
5
6
/**
7
 * parent class to provide the admin article model
8
 *
9
 * @since 4.0.0
10
 *
11
 * @package Redaxscript
12
 * @category Model
13
 * @author Henry Ruhs
14
 */
15
16
class Article extends BaseModel\Article
17
{
18
	/**
19
	 * is unique by id and alias
20
	 *
21
	 * @since 4.0.0
22
	 *
23
	 * @param int $articleId identifier of the article
24
	 * @param string $articleAlias alias of the article
25
	 *
26
	 * @return bool
27
	 */
28
29
	public function isUniqueByIdAndAlias(int $articleId = null, string $articleAlias = null) : bool
30
	{
31
		$categoryModel = new Category();
32
		return !$categoryModel->getByAlias($articleAlias)?->id && (!$this->getByAlias($articleAlias)?->id || $this->getByAlias($articleAlias)?->id === $this->getById($articleId)?->id);
0 ignored issues
show
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_OBJECT_OPERATOR
Loading history...
33
	}
34
35
	/**
36
	 * create the article by array
37
	 *
38
	 * @since 4.0.0
39
	 *
40
	 * @param array $createArray array of the create
41
	 *
42
	 * @return bool
43
	 */
44
45
	public function createByArray(array $createArray = []) : bool
46
	{
47
		return $this
48
			->query()
49
			->create()
50
			->set($createArray)
51
			->save();
52
	}
53
54
	/**
55
	 * update the article by id and array
56
	 *
57
	 * @since 4.0.0
58
	 *
59
	 * @param int $articleId identifier of the article
60
	 * @param array $updateArray array of the update
61
	 *
62
	 * @return bool
63
	 */
64
65
	public function updateByIdAndArray(int $articleId = null, array $updateArray = []) : bool
66
	{
67
		return $this
68
			->query()
69
			->whereIdIs($articleId)
70
			->findOne()
71
			->set($updateArray)
72
			->save();
73
	}
74
75
	/**
76
	 * publish the article by id
77
	 *
78
	 * @since 4.0.0
79
	 *
80
	 * @param int $articleId identifier of the article
81
	 *
82
	 * @return bool
83
	 */
84
85
	public function publishById(int $articleId = null) : bool
86
	{
87
		return (bool)$this
88
			->query()
89
			->whereAnyIs(
90
			[
91
				[
92
					'id' =>	$articleId
93
				],
94
				[
95
					'sibling' => $articleId
96
				]
97
			])
98
			->findMany()
99
			->set('status', 1)
100
			->save();
101
	}
102
103
	/**
104
	 * publish the article by category
105
	 *
106
	 * @since 4.0.0
107
	 *
108
	 * @param int $categoryId identifier of the category
109
	 *
110
	 * @return bool
111
	 */
112
113
	public function publishByCategory(int $categoryId = null) : bool
114
	{
115
		return (bool)$this
116
			->query()
117
			->where('category', $categoryId)
118
			->findMany()
119
			->set('status', 1)
120
			->save();
121
	}
122
123
	/**
124
	 * unpublish the article by id
125
	 *
126
	 * @since 4.0.0
127
	 *
128
	 * @param int $articleId identifier of the article
129
	 *
130
	 * @return bool
131
	 */
132
133
	public function unpublishById(int $articleId = null) : bool
134
	{
135
		return (bool)$this
136
			->query()
137
			->whereAnyIs(
138
			[
139
				[
140
					'id' =>	$articleId
141
				],
142
				[
143
					'sibling' => $articleId
144
				]
145
			])
146
			->findMany()
147
			->set('status', 0)
148
			->save();
149
	}
150
151
	/**
152
	 * unpublish the article by category
153
	 *
154
	 * @since 4.0.0
155
	 *
156
	 * @param int $categoryId identifier of the category
157
	 *
158
	 * @return bool
159
	 */
160
161
	public function unpublishByCategory(int $categoryId = null) : bool
162
	{
163
		return (bool)$this
164
			->query()
165
			->where('category', $categoryId)
166
			->findMany()
167
			->set('status', 0)
168
			->save();
169
	}
170
171
	/**
172
	 * delete the article by id
173
	 *
174
	 * @since 4.0.0
175
	 *
176
	 * @param int $articleId identifier of the article
177
	 *
178
	 * @return bool
179
	 */
180
181
	public function deleteById(int $articleId = null) : bool
182
	{
183
		return $this
184
			->query()
185
			->whereAnyIs(
186
			[
187
				[
188
					'id' =>	$articleId
189
				],
190
				[
191
					'sibling' => $articleId
192
				]
193
			])
194
			->deleteMany();
195
	}
196
197
	/**
198
	 * delete the article by category
199
	 *
200
	 * @since 4.0.0
201
	 *
202
	 * @param int $categoryId identifier of the category
203
	 *
204
	 * @return bool
205
	 */
206
207
	public function deleteByCategory(int $categoryId = null) : bool
208
	{
209
		return $this
210
			->query()
211
			->where('category', $categoryId)
212
			->deleteMany();
213
	}
214
}
215