Issues (26)

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/File.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
namespace League\Flysystem;
4
5
/**
6
 * @deprecated
7
 */
8
class File extends Handler
0 ignored issues
show
Deprecated Code introduced by Frank de Jonge
The class League\Flysystem\Handler has been deprecated.

This class, trait or interface has been deprecated.

Loading history...
9
{
10
    /**
11
     * Check whether the file exists.
12
     *
13
     * @return bool
14
     */
15 3
    public function exists()
16
    {
17 3
        return $this->filesystem->has($this->path);
18
    }
19
20
    /**
21
     * Read the file.
22
     *
23
     * @return string|false file contents
24
     */
25 24
    public function read()
26
    {
27 24
        return $this->filesystem->read($this->path);
28
    }
29
30
    /**
31
     * Read the file as a stream.
32
     *
33
     * @return resource|false file stream
34
     */
35 6
    public function readStream()
36
    {
37 6
        return $this->filesystem->readStream($this->path);
38
    }
39
40
    /**
41
     * Write the new file.
42
     *
43
     * @param string $content
44
     *
45
     * @return bool success boolean
46
     */
47 3
    public function write($content)
48
    {
49 3
        return $this->filesystem->write($this->path, $content);
50
    }
51
52
    /**
53
     * Write the new file using a stream.
54
     *
55
     * @param resource $resource
56
     *
57
     * @return bool success boolean
58
     */
59 3
    public function writeStream($resource)
60
    {
61 3
        return $this->filesystem->writeStream($this->path, $resource);
62
    }
63
64
    /**
65
     * Update the file contents.
66
     *
67
     * @param string $content
68
     *
69
     * @return bool success boolean
70
     */
71 6
    public function update($content)
72
    {
73 6
        return $this->filesystem->update($this->path, $content);
74
    }
75
76
    /**
77
     * Update the file contents with a stream.
78
     *
79
     * @param resource $resource
80
     *
81
     * @return bool success boolean
82
     */
83 6
    public function updateStream($resource)
84
    {
85 6
        return $this->filesystem->updateStream($this->path, $resource);
86
    }
87
88
    /**
89
     * Create the file or update if exists.
90
     *
91
     * @param string $content
92
     *
93
     * @return bool success boolean
94
     */
95 3
    public function put($content)
96
    {
97 3
        return $this->filesystem->put($this->path, $content);
98
    }
99
100
    /**
101
     * Create the file or update if exists using a stream.
102
     *
103
     * @param resource $resource
104
     *
105
     * @return bool success boolean
106
     */
107 3
    public function putStream($resource)
108
    {
109 3
        return $this->filesystem->putStream($this->path, $resource);
110
    }
111
112
    /**
113
     * Rename the file.
114
     *
115
     * @param string $newpath
116
     *
117
     * @return bool success boolean
118
     */
119 6
    public function rename($newpath)
120
    {
121 6
        if ($this->filesystem->rename($this->path, $newpath)) {
122 3
            $this->path = $newpath;
123
124 3
            return true;
125
        }
126
127 3
        return false;
128
    }
129
130
    /**
131
     * Copy the file.
132
     *
133
     * @param string $newpath
134
     *
135
     * @return File|false new file or false
136
     */
137 6
    public function copy($newpath)
138
    {
139 6
        if ($this->filesystem->copy($this->path, $newpath)) {
140 3
            return new File($this->filesystem, $newpath);
0 ignored issues
show
Deprecated Code introduced by Carson Full
The class League\Flysystem\File has been deprecated.

This class, trait or interface has been deprecated.

Loading history...
141
        }
142
143 3
        return false;
144
    }
145
146
    /**
147
     * Get the file's timestamp.
148
     *
149
     * @return string|false The timestamp or false on failure.
150
     */
151 6
    public function getTimestamp()
152
    {
153 6
        return $this->filesystem->getTimestamp($this->path);
154
    }
155
156
    /**
157
     * Get the file's mimetype.
158
     *
159
     * @return string|false The file mime-type or false on failure.
160
     */
161 6
    public function getMimetype()
162
    {
163 6
        return $this->filesystem->getMimetype($this->path);
164
    }
165
166
    /**
167
     * Get the file's visibility.
168
     *
169
     * @return string|false The visibility (public|private) or false on failure.
170
     */
171 6
    public function getVisibility()
172
    {
173 6
        return $this->filesystem->getVisibility($this->path);
174
    }
175
176
    /**
177
     * Get the file's metadata.
178
     *
179
     * @return array|false The file metadata or false on failure.
180
     */
181 6
    public function getMetadata()
182
    {
183 6
        return $this->filesystem->getMetadata($this->path);
184
    }
185
186
    /**
187
     * Get the file size.
188
     *
189
     * @return int|false The file size or false on failure.
190
     */
191 6
    public function getSize()
192
    {
193 6
        return $this->filesystem->getSize($this->path);
194
    }
195
196
    /**
197
     * Delete the file.
198
     *
199
     * @return bool success boolean
200
     */
201 6
    public function delete()
202
    {
203 6
        return $this->filesystem->delete($this->path);
204
    }
205
}
206