WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#7536 closed defect (bug) (fixed)

Avatar alt isn't attribute-escaped, nor translated

Reported by: nbachiyski Owned by:
Milestone: 2.7 Priority: normal
Severity: normal Version:
Component: General Keywords: has-patch
Focuses: Cc:

Description

In [8661] the avatar alt default value is Avatar and cannot be translated.

Also, if the avatar alt contains ' or tags, it will break the HTML code.

Attachments (2)

better-avatar-alt.diff (1.6 KB) - added by nbachiyski 6 years ago.
7536-fix-phpdoc.diff (725 bytes) - added by Speedboxer 6 years ago.
Change phpdoc to say that the default is blank

Download all attachments as: .zip

Change History (9)

comment:1 ryan6 years ago

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

(In [9076]) Avatar alt fixes from nbachiyski. fixes #7536

comment:2 follow-up: matt6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Giving every avatar a default alt text of "avatar" is very bad accesibility, I can't imagine anything more annoying to a screen reader.

http://en.wikipedia.org/wiki/Alt_attribute

"While the use of meaningful alt text is necessary to comply with accessibility standards, and is good practice, sometimes an image is used for purely decorative purposes. In this case, one should use an empty alt attribute (alt="")."

comment:3 in reply to: ↑ 2 ShaneF6 years ago

Replying to matt:

Giving every avatar a default alt text of "avatar" is very bad accesibility, I can't imagine anything more annoying to a screen reader.

Agree.

comment:4 westi6 years ago

Although I introduced this for #7523 I agree with matt here that the default should be empty.

Having a page full of Avatars being read out would get a little frustrating when viewing comments.

comment:5 westi6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [9127]) Default to an empty alt attribute on Avatars. Fixes #7536.

Speedboxer6 years ago

Change phpdoc to say that the default is blank

comment:6 Speedboxer6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

The phpdoc text needs to be changed to say the default is blank.

comment:7 ryan6 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [9200]) get_avatar() phpdoc update from Speedboxer. fixes #7536

Note: See TracTickets for help on using tickets.