Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit dc1e4b3

Browse filesBrowse files
MC-38508: Add static checks for PHP FS calls
1 parent 7959427 commit dc1e4b3
Copy full SHA for dc1e4b3

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Rule: getimagesize() is discouraged
2+
3+
## Reason
4+
5+
[getimagesize()](https://www.php.net/manual/en/function.getimagesize.php) function works only with local and supported streams.
6+
With introduction of more advanced storages, like AWS S3 or Azure Blob Storage this function will cause issues where file is not accessible.
7+
8+
## How to fix
9+
10+
[getimagesizefromstring](https://www.php.net/manual/en/function.getimagesizefromstring.php) can be used instead to retrieve all the information from file.
11+
This function works with data strings, so you should read the file content using specific adapter before using it.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.