Make WordPress Core

Opened 16 months ago

Closed 16 months ago

Last modified 16 months ago

#55154 closed defect (bug) (fixed)

Typo in a comment in wp_get_image_mime()

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.0 Priority: normal
Severity: trivial Version:
Component: Media Keywords: good-first-bug has-patch
Focuses: docs Cc:

Description

There is a comment block in wp_get_image_mime():

/*
 * Use exif_imagetype() to check the mimetype if available or fall back to
 * getimagesize() if exif isn't avaialbe. If either function throws an Exception
 * we assume the file could not be validated.
 */

"avaialbe" here should be "available".

Introduced in [39831] / #11946.

Attachments (1)

55154.patch (627 bytes) - added by dilipbheda 16 months ago.

Download all attachments as: .zip

Change History (5)

@dilipbheda
16 months ago

#1 @dilipbheda
16 months ago

  • Keywords has-patch added; needs-patch removed

#2 follow-up: @SergeyBiryukov
16 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 52719:

Docs: Fix typo in a comment in wp_get_image_mime().

Follow-up to [39831].

Props dilipbheda.
Fixes #55154.

#3 in reply to: ↑ 2 ; follow-up: @azouamauriac
16 months ago

Replying to SergeyBiryukov:

In 52719:

Docs: Fix typo in a comment in wp_get_image_mime().

Follow-up to [39831].

Props dilipbheda.
Fixes #55154.

Hi I think the first word in the comment should be "uses" as it referred to the third person of singular what replace "the block".

So it should be

<?php
/*
* (it) Uses exif_imagetype() to check...
*/

Without the "it". "It" referred to the block.

RE: https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#language

#4 in reply to: ↑ 3 @SergeyBiryukov
16 months ago

Replying to azouamauriac:

Hi I think the first word in the comment should be "uses" as it referred to the third person of singular what replace "the block".

Thanks for the note! That recommendation from the documentation standards refers to function DocBlocks, however this is just an inline comment and not a DocBlock, so it looks fine to me as is. It describes the next few lines of the code, and not what the function does in general. The function DocBlock does use a third-person singular verb:

Returns the real mime type of an image file.

Note: See TracTickets for help on using tickets.