Conditions | 4 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public static function fixDestination(Uploader $uploader, $original) |
||
24 | { |
||
25 | if (!$uploader->getFilename()) { |
||
|
|||
26 | $uploader->setFilename(uniqid()); |
||
27 | } |
||
28 | |||
29 | $fileData = explode(';base64,', $original, 2); |
||
30 | |||
31 | if (!$uploader->getExtension() && preg_match('|data:\w+/(\w+)|', $fileData[0], $match)) { |
||
32 | $uploader->setExtension($match[1]); |
||
33 | } |
||
34 | } |
||
35 | |||
48 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: