Issues (20)

Security Analysis    no request data  

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.

src/Model/Topic.php (1 issue)

1
<?php
2
3
namespace PhpEarth\Stats\Model;
4
5
/**
6
 * Class Topic.
7
 */
8
class Topic
9
{
10
    /**
11
     * @var int Topic id.
12
     */
13
    private $id;
14
15
    /**
16
     * @var User Topic's author.
17
     */
18
    private $user;
19
20
    /**
21
     * @var string
22
     */
23
    private $createdTime;
24
25
    /**
26
     * @var int
27
     */
28
    private $reactionsCount = 0;
29
30
    /**
31
     * @var int
32
     */
33
    private $commentsCount = 0;
34
35
    /**
36
     * @var string
37
     */
38
    private $message = '';
39
40
    /**
41
     * @var bool
42
     */
43
    private $canComment = true;
44
45
    /**
46
     * @var string
47
     */
48
    private $type;
49
50
    /**
51
     * @var int
52
     */
53
    private $sharesCount = 0;
54
55
    /**
56
     * Set topic id.
57
     *
58
     * @param $id
59
     */
60
    public function setId($id)
61
    {
62
        $this->id = $id;
63
    }
64
65
    /**
66
     * Get topic id.
67
     *
68
     * @return mixed
69
     */
70
    public function getId()
71
    {
72
        return $this->id;
73
    }
74
75
    /**
76
     * Set the topic's author.
77
     *
78
     * @param User $user
79
     */
80
    public function setUser(User $user)
81
    {
82
        $this->user = $user;
83
    }
84
85
    /**
86
     * Get topic author.
87
     *
88
     * @return User
89
     */
90
    public function getUser()
91
    {
92
        return $this->user;
93
    }
94
95
    /**
96
     * Set created time of the topic.
97
     *
98
     * @param string $createdTime
99
     */
100
    public function setCreatedTime($createdTime)
101
    {
102
        $this->createdTime = $createdTime;
103
    }
104
105
    /**
106
     * Get created time of the topic.
107
     *
108
     * @return string
109
     */
110
    public function getCreatedTime()
111
    {
112
        return $this->createdTime;
113
    }
114
115
    /**
116
     * Set number of topic reactions.
117
     *
118
     * @param int $reactionsCount
119
     */
120
    public function setReactionsCount($reactionsCount)
121
    {
122
        $this->reactionsCount = $reactionsCount;
123
    }
124
125
    /**
126
     * Get number of topic reactions.
127
     *
128
     * @return int
129
     */
130
    public function getReactionsCount()
131
    {
132
        return $this->reactionsCount;
133
    }
134
135
    /**
136
     * Set topic's number of comments and replies.
137
     *
138
     * @param int $commentsCount
139
     */
140
    public function setCommentsCount($commentsCount)
141
    {
142
        $this->commentsCount = $commentsCount;
143
    }
144
145
    /**
146
     * Get topic's number of comments and replies.
147
     *
148
     * @return int
149
     */
150
    public function getCommentsCount()
151
    {
152
        return $this->commentsCount;
153
    }
154
155
    /**
156
     * Set topic's message.
157
     *
158
     * @param string $message
159
     */
160
    public function setMessage($message)
161
    {
162
        $this->message = $message;
163
    }
164
165
    /**
166
     * Get topic's message.
167
     *
168
     * @return string
169
     */
170
    public function getMessage()
171
    {
172
        return $this->message;
173
    }
174
175
    /**
176
     * Set the boolean value whether the commenting is turned off or not.
177
     *
178
     * @param bool $canComment
179
     */
180
    public function setCanComment($canComment)
181
    {
182
        $this->canComment = $canComment;
183
    }
184
185
    /**
186
     * Get post type.
187
     *
188
     * @return string
189
     */
190
    public function getType()
191
    {
192
        return $this->type;
193
    }
194
195
    /**
196
     * Set the topic type (photo, status, animated_image_share...)
197
     *
198
     * @param string $type
199
     */
200
    public function setType($type)
201
    {
202
        $this->type = $type;
203
    }
204
205
    /**
206
     * Get boolean value whether topic has comments turned off or not.
207
     *
208
     * @return bool
209
     */
210
    public function getCanComment()
211
    {
212
        return $this->canComment;
213
    }
214
215
    /**
216
     * Unique Facebook post ID in groups has format {group_id}_{topic_id}.
217
     * Returns only the last part of the topic ID that is needed for permalink URL.
218
     *
219
     * @return int
220
     */
221
    public function getPermalinkPostId()
222
    {
223
        return substr($this->getId(), strpos($this->getId(), '_') + 1);
0 ignored issues
show
Bug Best Practice introduced by
The expression return substr($this->get...his->getId(), '_') + 1) returns the type string which is incompatible with the documented return type integer.
Loading history...
224
    }
225
226
    /**
227
     * Set topic's number of shares.
228
     *
229
     * @param int $sharesCount
230
     */
231
    public function setSharesCount($sharesCount)
232
    {
233
        $this->sharesCount = $sharesCount;
234
    }
235
236
    /**
237
     * Get topic's number of shares.
238
     *
239
     * @return int
240
     */
241
    public function getSharesCount()
242
    {
243
        return $this->sharesCount;
244
    }
245
}
246