Skip to content

Commit 5558c2e

Browse files
authored
Merge pull request #5 from magento-commerce/imported-magento-magento-coding-standard-199
[Imported] Master update
2 parents 0e6f0c7 + e1eb38e commit 5558c2e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
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)