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 e1eb38e

Browse filesBrowse files
authored
Merge pull request #4 from magento-commerce/imported-magento-magento-coding-standard-198
[Imported] Discourage local-FS-only methods
2 parents b74f41f + 98e9fff commit e1eb38e
Copy full SHA for e1eb38e

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.