This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <!DOCTYPE html> |
||
2 | <html> |
||
3 | <head> |
||
4 | <meta charset="utf-8" /> |
||
5 | <style type="text/css"> |
||
6 | body |
||
7 | { |
||
8 | font-family: Corbel, Arial, sans-serif; |
||
9 | padding: 20px 50px; |
||
10 | } |
||
11 | div.Agent |
||
12 | { |
||
13 | padding: 20px; |
||
14 | border: 1px solid #ddd; |
||
15 | background-color: #fafafa; |
||
16 | } |
||
17 | img |
||
18 | { |
||
19 | float: right; |
||
20 | margin: 10px; |
||
21 | padding: 10px; |
||
22 | border: 1px solid #ddd; |
||
23 | } |
||
24 | </style> |
||
25 | </head> |
||
26 | <body> |
||
27 | |||
28 | <?php |
||
29 | require_once('vCard.php'); |
||
30 | |||
31 | /** |
||
32 | * Test function for vCard content output |
||
33 | * @param vCard vCard object |
||
34 | */ |
||
35 | function OutputvCard(vCard $vCard) |
||
36 | { |
||
37 | echo '<h2>'.$vCard -> FN[0].'</h2>'; |
||
0 ignored issues
–
show
|
|||
38 | |||
39 | if ($vCard -> PHOTO) |
||
0 ignored issues
–
show
The property
PHOTO does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
40 | { |
||
41 | foreach ($vCard -> PHOTO as $Photo) |
||
0 ignored issues
–
show
The property
PHOTO does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
42 | { |
||
43 | if ($Photo['encoding'] == 'b') |
||
44 | { |
||
45 | echo '<img src="data:image/'.$Photo['type'][0].';base64,'.$Photo['value'].'" /><br />'; |
||
46 | } |
||
47 | else |
||
48 | { |
||
49 | echo '<img src="'.$Photo['value'].'" /><br />'; |
||
50 | } |
||
51 | |||
52 | /* |
||
53 | // It can also be saved to a file |
||
54 | try |
||
55 | { |
||
56 | $vCard -> SaveFile('photo', 0, 'test_image.jpg'); |
||
57 | // The parameters are: |
||
58 | // - name of the file we want to save (photo, logo or sound) |
||
59 | // - index of the file in case of multiple files (defaults to 0) |
||
60 | // - target path to save to, including the filenam |
||
61 | } |
||
62 | catch (Exception $E) |
||
63 | { |
||
64 | // Target path not writable |
||
65 | } |
||
66 | */ |
||
67 | } |
||
68 | } |
||
69 | |||
70 | foreach ($vCard -> N as $Name) |
||
0 ignored issues
–
show
The property
N does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
71 | { |
||
72 | echo '<h3>Name: '.$Name['firstname'].' '.$Name['lastname'].'</h3>'; |
||
73 | } |
||
74 | |||
75 | foreach ($vCard -> ORG as $Organization) |
||
0 ignored issues
–
show
The property
ORG does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
76 | { |
||
77 | echo '<h3>Organization: '.$Organization['name']. |
||
78 | ($Organization['unit1'] || $Organization['unit2'] ? |
||
79 | ' ('.implode(', ', array($Organization['unit1'], $Organization['unit2'])).')' : |
||
80 | '' |
||
81 | ).'</h3>'; |
||
82 | } |
||
83 | |||
84 | View Code Duplication | if ($vCard -> TEL) |
|
0 ignored issues
–
show
The property
TEL does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
85 | { |
||
86 | echo '<p><h4>Phone</h4>'; |
||
87 | foreach ($vCard -> TEL as $Tel) |
||
0 ignored issues
–
show
The property
TEL does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
88 | { |
||
89 | if (is_scalar($Tel)) |
||
90 | { |
||
91 | echo $Tel.'<br />'; |
||
92 | } |
||
93 | else |
||
94 | { |
||
95 | echo $Tel['value'].' ('.implode(', ', $Tel['type']).')<br />'; |
||
96 | } |
||
97 | } |
||
98 | echo '</p>'; |
||
99 | } |
||
100 | |||
101 | View Code Duplication | if ($vCard -> EMAIL) |
|
0 ignored issues
–
show
The property
EMAIL does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() This code seems to be duplicated across your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation. You can also find more detailed suggestions in the “Code” section of your repository. ![]() |
|||
102 | { |
||
103 | echo '<p><h4>Email</h4>'; |
||
104 | foreach ($vCard -> EMAIL as $Email) |
||
0 ignored issues
–
show
The property
EMAIL does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
105 | { |
||
106 | if (is_scalar($Email)) |
||
107 | { |
||
108 | echo $Email; |
||
109 | } |
||
110 | else |
||
111 | { |
||
112 | echo $Email['value'].' ('.implode(', ', $Email['type']).')<br />'; |
||
113 | } |
||
114 | } |
||
115 | echo '</p>'; |
||
116 | } |
||
117 | |||
118 | if ($vCard -> URL) |
||
0 ignored issues
–
show
The property
URL does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
119 | { |
||
120 | echo '<p><h4>URL</h4>'; |
||
121 | foreach ($vCard -> URL as $URL) |
||
0 ignored issues
–
show
The property
URL does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
122 | { |
||
123 | if (is_scalar($URL)) |
||
124 | { |
||
125 | echo $URL.'<br />'; |
||
126 | } |
||
127 | else |
||
128 | { |
||
129 | echo $URL['value'].'<br />'; |
||
130 | } |
||
131 | } |
||
132 | echo '</p>'; |
||
133 | } |
||
134 | |||
135 | if ($vCard -> IMPP) |
||
0 ignored issues
–
show
The property
IMPP does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
136 | { |
||
137 | echo '<p><h4>Instant messaging</h4>'; |
||
138 | foreach ($vCard -> IMPP as $IMPP) |
||
0 ignored issues
–
show
The property
IMPP does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
139 | { |
||
140 | if (is_scalar($IMPP)) |
||
141 | { |
||
142 | echo $IMPP.'<br />'; |
||
143 | } |
||
144 | else |
||
145 | { |
||
146 | echo $IMPP['value'].'<br/ >'; |
||
147 | } |
||
148 | } |
||
149 | echo '</p>'; |
||
150 | } |
||
151 | |||
152 | if ($vCard -> ADR) |
||
0 ignored issues
–
show
The property
ADR does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
153 | { |
||
154 | foreach ($vCard -> ADR as $Address) |
||
0 ignored issues
–
show
The property
ADR does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
155 | { |
||
156 | echo '<p><h4>Address ('.implode(', ', $Address['type']).')</h4>'; |
||
157 | echo 'Street address: <strong>'.($Address['streetaddress'] ? $Address['streetaddress'] : '-').'</strong><br />'. |
||
158 | 'PO Box: <strong>'.($Address['pobox'] ? $Address['pobox'] : '-').'</strong><br />'. |
||
159 | 'Extended address: <strong>'.($Address['extendedaddress'] ? $Address['extendedaddress'] : '-').'</strong><br />'. |
||
160 | 'Locality: <strong>'.($Address['locality'] ? $Address['locality'] : '-').'</strong><br />'. |
||
161 | 'Region: <strong>'.($Address['region'] ? $Address['region'] : '-').'</strong><br />'. |
||
162 | 'ZIP/Post code: <strong>'.($Address['postalcode'] ? $Address['postalcode'] : '-').'</strong><br />'. |
||
163 | 'Country: <strong>'.($Address['country'] ? $Address['country'] : '-').'</strong>'; |
||
164 | } |
||
165 | echo '</p>'; |
||
166 | } |
||
167 | |||
168 | if ($vCard -> AGENT) |
||
0 ignored issues
–
show
The property
AGENT does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
169 | { |
||
170 | echo '<h4>Agents</h4>'; |
||
171 | foreach ($vCard -> AGENT as $Agent) |
||
0 ignored issues
–
show
The property
AGENT does not exist on object<vCard> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
172 | { |
||
173 | if (is_scalar($Agent)) |
||
174 | { |
||
175 | echo '<div class="Agent">'.$Agent.'</div>'; |
||
176 | } |
||
177 | elseif (is_a($Agent, 'vCard')) |
||
178 | { |
||
179 | echo '<div class="Agent">'; |
||
180 | OutputvCard($Agent); |
||
181 | echo '</div>'; |
||
182 | } |
||
183 | } |
||
184 | } |
||
185 | } |
||
186 | |||
187 | $vCard = new vCard( |
||
188 | 'Example3.0.vcf', // Path to vCard file |
||
0 ignored issues
–
show
'Example3.0.vcf' is of type string , but the function expects a boolean .
It seems like the type of the argument is not accepted by the function/method which you are calling. In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug. We suggest to add an explicit type cast like in the following example: function acceptsInteger($int) { }
$x = '123'; // string "123"
// Instead of
acceptsInteger($x);
// we recommend to use
acceptsInteger((integer) $x);
![]() |
|||
189 | false, // Raw vCard text, can be used instead of a file |
||
190 | array( // Option array |
||
191 | // This lets you get single values for elements that could contain multiple values but have only one value. |
||
192 | // This defaults to false so every value that could have multiple values is returned as array. |
||
193 | 'Collapse' => false |
||
194 | ) |
||
195 | ); |
||
196 | |||
197 | if (count($vCard) == 0) |
||
198 | { |
||
199 | throw new Exception('vCard test: empty vCard!'); |
||
200 | } |
||
201 | // if the file contains a single vCard, it is accessible directly. |
||
202 | elseif (count($vCard) == 1) |
||
203 | { |
||
204 | OutputvCard($vCard); |
||
205 | } |
||
206 | // if the file contains multiple vCards, they are accessible as elements of an array |
||
207 | else |
||
208 | { |
||
209 | foreach ($vCard as $Index => $vCardPart) |
||
210 | { |
||
211 | OutputvCard($vCardPart); |
||
212 | } |
||
213 | } |
||
214 | ?> |
||
215 | </body> |
||
216 | </html> |
||
217 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.