Fatal error (division by zero) in AMP_Core_Theme_Sanitizer::add_twentytwenty_custom_logo_fix()
#7427
Labels
Milestone
AMP_Core_Theme_Sanitizer::add_twentytwenty_custom_logo_fix()
#7427
Bug Description
See support topic.
This code is not accounting for the case where the site logo image for some reason has a height of zero:
amp-wp/includes/sanitizers/class-amp-core-theme-sanitizer.php
Lines 878 to 879 in 4e54b03
This is also the case in this line:
amp-wp/includes/sanitizers/class-amp-core-theme-sanitizer.php
Line 590 in 4e54b03
In both cases, we should make sure that when we cast the value to
int
that it is not zero, and if so, bail.Expected Behaviour
No fatal error caused by division by zero should occur when site logo has an unexpected height of zero.
Screenshots
No response
PHP Version
No response
Plugin Version
2.3.0
AMP plugin template mode
Standard, Transitional
WordPress Version
No response
Site Health
No response
Gutenberg Version
No response
OS(s) Affected
No response
Browser(s) Affected
No response
Device(s) Affected
No response
Acceptance Criteria
No response
Implementation Brief
No response
QA Testing Instructions
No response
Demo
No response
Changelog Entry
No response
The text was updated successfully, but these errors were encountered: