ExpressionEngine / ExpressionEngine

ExpressionEngine is a flexible, feature-rich, free open-source content management platform that empowers hundreds of thousands of individuals and organizations around the world to easily manage their web site.

Home Page:https://expressionengine.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EE Warning re: file dimensions with SVG

ttmwebdesign opened this issue · comments

commented

Description of the problem
EE warnings shown with either debug=1 or 2 on the config.php file, on any page with an SVG that was uploaded into the file manager. One warning per SVG on the page:

Warning
Undefined array key 1
ee/ExpressionEngine/Model/File/FileDimension.php, line 123

Severity: E_WARNING

Looking at the SVG in file manager, I believe this is due to it having its dimensions as 'x px' or nothing is present at all, and not a numerical representation. See screenshots of the two examples.

How To Reproduce
Steps to reproduce the behavior:

  1. Upload SVG.
  2. Load front end page with SVG.
  3. If logged in w/debug running, see warning, one for every SVG on the page uploaded & called by the fields from file manager.

Error Messages


Warning
Undefined array key 1
ee/ExpressionEngine/Model/File/FileDimension.php, line 123

Severity: E_WARNING

This is the extent of the warnings, even with debug=2 on config.php and debug=1 on index.php.

Screenshots / Videos / Template Code

Screenshot-1 Screenshot-2

Environment Details:

  • Version: 7.4.6
  • PHP Version 8.1 (both local/staging)
  • MariaDB Version 10.4.32 (local) // MySQL 8.x (staging)
  • OS: macOS (local) // Ubuntu 22.04 (staging)
  • Web Server: nginx (both)

Possible Solution
Since it only appears with debug on, it will of course be set to 0 for the client but it would be great to make it go away on local builds and staging when it's set to debug other than 0.

Additional context
n/a

Thanks!

Can also confirm this is happening.