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

Labels
Severity

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 category model
8
 *
9
 * @since 4.0.0
10
 *
11
 * @package Redaxscript
12
 * @category Model
13
 * @author Henry Ruhs
14
 */
15
16
class Category extends BaseModel\Category
17
{
18
	/**
19
	 * is unique by id and alias
20
	 *
21
	 * @since 4.0.0
22
	 *
23
	 * @param int $categoryId identifier of the category
24
	 * @param string $categoryAlias alias of the category
25
	 *
26
	 * @return bool
27
	 */
28
29
	public function isUniqueByIdAndAlias(int $categoryId = null, string $categoryAlias = null) : bool
30
	{
31
		$articleModel = new Article();
32
		return !$articleModel->getByAlias($categoryAlias)?->id && (!$this->getByAlias($categoryAlias)?->id || $this->getByAlias($categoryAlias)?->id === $this->getById($categoryId)?->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 category 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 category by id and array
56
	 *
57
	 * @since 4.0.0
58
	 *
59
	 * @param int $categoryId identifier of the category
60
	 * @param array $updateArray array of the update
61
	 *
62
	 * @return bool
63
	 */
64
65
	public function updateByIdAndArray(int $categoryId = null, array $updateArray = []) : bool
66
	{
67
		return $this
68
			->query()
69
			->whereIdIs($categoryId)
70
			->findOne()
71
			->set($updateArray)
72
			->save();
73
	}
74
75
	/**
76
	 * publish the category by id
77
	 *
78
	 * @since 4.0.0
79
	 *
80
	 * @param int $categoryId identifier of the category
81
	 *
82
	 * @return bool
83
	 */
84
85
	public function publishById(int $categoryId = null) : bool
86
	{
87
		return (bool)$this
88
			->query()
89
			->whereAnyIs(
90
			[
91
				[
92
					'id' =>	$categoryId
93
				],
94
				[
95
					'parent' => $categoryId
96
				],
97
				[
98
					'sibling' => $categoryId
99
				]
100
			])
101
			->findMany()
102
			->set('status', 1)
103
			->save();
104
	}
105
106
	/**
107
	 * unpublish the category by id
108
	 *
109
	 * @since 4.0.0
110
	 *
111
	 * @param int $categoryId identifier of the category
112
	 *
113
	 * @return bool
114
	 */
115
116
	public function unpublishById(int $categoryId = null) : bool
117
	{
118
		return (bool)$this
119
			->query()
120
			->whereAnyIs(
121
			[
122
				[
123
					'id' =>	$categoryId
124
				],
125
				[
126
					'parent' => $categoryId
127
				],
128
				[
129
					'sibling' => $categoryId
130
				]
131
			])
132
			->findMany()
133
			->set('status', 0)
134
			->save();
135
	}
136
137
	/**
138
	 * delete the category by id
139
	 *
140
	 * @since 4.0.0
141
	 *
142
	 * @param int $categoryId identifier of the category
143
	 *
144
	 * @return bool
145
	 */
146
147
	public function deleteById(int $categoryId = null) : bool
148
	{
149
		return $this
150
		->query()
151
		->whereAnyIs(
152
		[
153
			[
154
				'id' =>	$categoryId
155
			],
156
			[
157
				'parent' => $categoryId
158
			],
159
			[
160
				'sibling' => $categoryId
161
			]
162
		])
163
		->deleteMany();
164
	}
165
}
166