Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#55154 closed defect (bug) (fixed)

Typo in a comment in wp_get_image_mime()

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

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 5 years ago.

Download all attachments as: .zip

Change History (5)

#1 @dilipbheda
5 years ago

  • Keywords has-patch added; needs-patch removed

#2 follow-up: @SergeyBiryukov
5 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → 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
5 years 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
5 years 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.