Issues (118)

Security Analysis    not enabled

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.

Messaging/Event/ReadStatusMessageEvent.php (2 issues)

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
3
/*
4
 * This file is part of the MilioooMessageBundle package.
5
 *
6
 * (c) Michiel boeckaert <[email protected]>
7
 * This source file is subject to the MIT license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Miliooo\Messaging\Event;
12
13
use Miliooo\Messaging\Model\MessageInterface;
14
use Miliooo\Messaging\Model\MessageMetaInterface;
15
use Miliooo\Messaging\User\ParticipantInterface;
16
use Miliooo\Messaging\Model\ThreadInterface;
17
use Symfony\Component\EventDispatcher\Event;
18
19
/**
20
 * Model for messages from whom the read status has changed.
21
 *
22
 * @author Michiel Boeckaert <[email protected]>
23
 */
24
class ReadStatusMessageEvent extends Event
25
{
26
    /**
27
     * The message from whom the read status has changed.
28
     *
29
     * @var MessageInterface
30
     */
31
    protected $message;
32
33
    /**
34
     * The participant from whom the read status has changed.
35
     *
36
     * @var ParticipantInterface
37
     */
38
    protected $participant;
39
40
    /**
41
     * Constructor.
42
     *
43
     * @param MessageInterface     $message
44
     * @param ParticipantInterface $participant
45
     */
46
    public function __construct(MessageInterface $message, ParticipantInterface $participant)
47
    {
48
        $this->message = $message;
49
        $this->participant = $participant;
50
    }
51
52
    /**
53
     * Gets the message where the read status has changed.
54
     *
55
     * @return MessageInterface
56
     */
57
    public function getMessage()
58
    {
59
        return $this->message;
60
    }
61
62
    /**
63
     * Gets the thread for the given message.
64
     *
65
     * @return ThreadInterface
66
     */
67
    public function getThread()
68
    {
69
        return $this->message->getThread();
70
    }
71
72
    /**
73
     * Gets the old read status.
74
     *
75
     * @return integer one of MessageInterface read status constants
76
     */
77
    public function getPreviousReadStatus()
78
    {
79
        return $this->message->getMessageMetaForParticipant($this->participant)->getPreviousReadStatus();
80
    }
81
82
    /**
83
     * Gets the new read status.
84
     *
85
     * @return integer one of MessageInterface read status constants
86
     */
87
    public function getReadStatus()
88
    {
89
        return $this->message->getMessageMetaForParticipant($this->participant)->getReadStatus();
90
    }
91
92
    /**
93
     * Returns whether the message has been read for the first time by the given participant.
94
     *
95
     * @return boolean true if read for the first time, false otherwise
96
     */
97
    public function isFirstTimeRead()
98
    {
99
        if ($this->getPreviousReadStatus() === MessageMetaInterface::READ_STATUS_NEVER_READ
0 ignored issues
show
This if statement, and the following return statement can be replaced with return $this->getPreviou...face::READ_STATUS_READ;.
Loading history...
100
            && $this->getReadStatus() === MessageMetaInterface::READ_STATUS_READ) {
0 ignored issues
show
Blank line found at start of control structure
Loading history...
101
102
            return true;
103
        }
104
105
        return false;
106
    }
107
108
    /**
109
     * Gets the participant for whom the read status of the message has changed.
110
     *
111
     * @return ParticipantInterface The participant for whom the message read status has changed.
112
     */
113
    public function getParticipant()
114
    {
115
        return $this->participant;
116
    }
117
}
118