Issues (32)

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.

src/Protocol/VCard.php (9 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
namespace Fabiang\Xmpp\Protocol;
4
5
use Fabiang\Xmpp\Util\XML;
6
7
/**
8
 * Protocol setting for Xmpp.
9
 *
10
 * @package Xmpp\Protocol
11
 */
12
class VCard implements ProtocolImplementationInterface
13
{
14
15
    /**
16
     * vCard to.
17
     *
18
     * @var string|null
19
     */
20
    protected $to;
21
22
23
    /**
24
     * user firstname.
25
     *
26
     * @var string
27
     */
28
    protected $firstname;
29
30
    /**
31
     * user lastname.
32
     *
33
     * @var string
34
     */
35
    protected $lastname;
36
37
    protected $jabberid;
38
39
    protected $mime;
40
41
    protected $image;
42
43
    protected $ulr;
44
45
    /**
46
     * Constructor.
47
     *
48
     * @param integer $priority
0 ignored issues
show
There is no parameter named $priority. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
49
     * @param string $to
0 ignored issues
show
There is no parameter named $to. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
50
     * @param string $nickname
0 ignored issues
show
There is no parameter named $nickname. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
51
     */
52
    public function __construct($firstname = null, $lastname = null,  $jabberid = null)
0 ignored issues
show
Expected 1 space between comma and argument "$jabberid"; 2 found
Loading history...
53
    {
54
        $this->setFirstname($firstname);
55
        $this->setLastname($lastname);
56
        $this->setJabberID($jabberid);
57
    }
58
59
    /**
60
     * {@inheritDoc}
61
     */
62
    public function toString()
63
    {
64
65
         return XML::quoteMessage(
66
            '<iq id="' . XML::generateId() . '" type="set">
67
              <vCard xmlns="vcard-temp">
68
                <FN>%s</FN>
69
                <N>
70
                  <FAMILY>%s</FAMILY>
71
                  <GIVEN>%s</GIVEN>
72
                  <MIDDLE/>
73
                </N>
74
                <NICKNAME>%s</NICKNAME>
75
                <URL>%s</URL>
76
                <PHOTO>
77
                  <TYPE>%s</TYPE>
78
                  <BINVAL>
79
                    %s
80
                  </BINVAL>
81
                </PHOTO>
82
                <JABBERID>%s</JABBERID>
83
                <DESC/>
84
              </vCard>
85
            </iq>',
86
            $this->getFirstname().' '.$this->getLastname(),
87
            $this->getLastname(),
88
            $this->getFirstname(),
89
            $this->getFirstname().' '.$this->getLastname(),
90
            $this->getUrl(),
91
            $this->getMime(),
92
            $this->getImage(),
93
            $this->getJabberID()
94
        );
95
    }
96
97
    /**
98
     * Get nickname.
99
     *
100
     * @return string
101
     */
102
    public function getFirstname()
103
    {
104
        return $this->firstname;
105
    }
106
107
    /**
108
     * Set nickname.
109
     *
110
     * @param string $nickname
0 ignored issues
show
There is no parameter named $nickname. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
111
     * @return $this
112
     */
113
    public function setFirstname($firstname)
114
    {
115
        $this->firstname = (string) $firstname;
116
        return $this;
117
    }
118
119
    /**
120
     * Get nickname.
121
     *
122
     * @return string
123
     */
124
    public function getLastname()
125
    {
126
        return $this->lastname;
127
    }
128
129
    /**
130
     * Set nickname.
131
     *
132
     * @param string $nickname
0 ignored issues
show
There is no parameter named $nickname. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
133
     * @return $this
134
     */
135
    public function setLastname($lastname)
136
    {
137
        $this->lastname = (string) $lastname;
138
        return $this;
139
    }
140
141
    /**
142
     * Get JabberID.
143
     *
144
     * @return string
145
     */
146
    public function getJabberID()
147
    {
148
        return $this->jabberid;
149
    }
150
151
    /**
152
     * Set abberID.
153
     *
154
     * @param string $nickname
0 ignored issues
show
There is no parameter named $nickname. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
155
     * @return $this
156
     */
157
    public function setJabberID($jabberid)
158
    {
159
        $this->jabberid = (string) $jabberid;
160
        return $this;
161
    }
162
163
    /**
164
     * Get mime.
165
     *
166
     * @return string
167
     */
168
    public function getMime()
169
    {
170
        return $this->mime;
171
    }
172
173
    /**
174
     * Set mime.
175
     *
176
     * @param string $mime
177
     * @return $this
178
     */
179
    public function setMime($mime)
180
    {
181
        $this->mime = (string) $mime;
182
        return $this;
183
    }
184
185
    /**
186
     * Get image.
187
     *
188
     * @return string
189
     */
190
    public function getImage()
191
    {
192
        return $this->image;
193
    }
194
195
    /**
196
     * Set image.
197
     *
198
     * @param string $image base64
199
     * @return $this
200
     */
201
    public function setImage($image)
202
    {
203
        $this->image = (string) $image;
204
        return $this;
205
    }
206
207
    /**
208
     * Get url.
209
     *
210
     * @return string
211
     */
212
    public function getUrl()
213
    {
214
        return $this->url;
0 ignored issues
show
The property url does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
215
    }
216
217
    /**
218
     * Set url.
219
     *
220
     * @param string $image base64
0 ignored issues
show
There is no parameter named $image. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
221
     * @return $this
222
     */
223
    public function setUrl($url)
224
    {
225
        $this->url = (string) $url;
226
        return $this;
227
    }
228
}
229