Opened 3 years ago
Closed 3 years ago
#53680 closed defect (bug) (fixed)
Correct inline documentation about `IMAGETYPE_WEBP` and `IMG_WEBP`
Reported by: | GaryJ | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.8.1 | Priority: | normal |
Severity: | minor | Version: | |
Component: | Media | Keywords: | good-first-bug has-patch fixed-major |
Focuses: | docs | Cc: |
Description
From ticket:35725#comment:195:
The
// WebP constants are only defined in PHP 7.1+.
comment in the code suggests that bothIMAGETYPE_WEBP
andIMG_WEBP
were defined in PHP 7.1.
According to https://www.php.net/manual/en/function.imagetypes.php and https://www.php.net/manual/en/image.constants.php, the
IMG_WEBP
constant was available at 7.0.10, so the current comment is misleading.
This inline comment should be updated to be accurate.
Attachments (1)
Change History (7)
#2
@
3 years ago
Thanks for catching this! Looks like it should be two separate comments:
// IMAGETYPE_WEBP is only defined in PHP 7.1 or later. if ( ! defined( 'IMAGETYPE_WEBP' ) ) { define( 'IMAGETYPE_WEBP', 18 ); } // IMG_WEBP is only defined in PHP 7.0.10 or later. if ( ! defined( 'IMG_WEBP' ) ) { define( 'IMG_WEBP', IMAGETYPE_WEBP ); // phpcs:ignore PHPCompatibility.Constants.NewConstants.imagetype_webpFound }
#4
@
3 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 51474:
Note: See
TracTickets for help on using
tickets.
Changing the reporter to reflect who first noticed the issue.