Opened 10 years ago
Closed 9 years ago
#30297 closed defect (bug) (fixed)
Notice for missing HTTP_USER_AGENT in get_calendar
Reported by: | elusiveunit | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 4.4 | Priority: | normal |
Severity: | normal | Version: | 1.0 |
Component: | Widgets | Keywords: | has-patch dev-feedback |
Focuses: | accessibility, template | Cc: |
Description
Just like in #27374, a notice can appear if $_SERVER['HTTP_USER_AGENT']
isn't set.
All other checks for HTTP_USER_AGENT I found were preceded by $is_X
or wp_is_mobile()
, which should stop any notices from happening.
Attachments (6)
Change History (13)
#1
@
10 years ago
- Focuses administration added
- Keywords has-patch added
I think it does not require any extra variable only placing isset
as a first condition will do the job. Added modified version of patch for this.
#2
@
10 years ago
- Focuses template added; administration removed
Of course, I just think shorter line lengths are more readable. Either way is fine.
#3
@
9 years ago
Refreshed again, this time with just the simpler version.
Also added patch for just removing the conditional, since it seems to be from IE6 days and is probably pointless now.
#4
@
9 years ago
- Focuses accessibility added
- Keywords dev-feedback added
- Milestone changed from Awaiting Review to 4.4
The title
attributes here are used to output the list of post titles for each day in the calendar. They get very unwieldy once there's more than a handful of posts on a given day. Line breaks in attributes are nasty, too.
Accessibility team: what do you think about removing the title
attributes here entirely? Could they be improved to provide more useful information, or is that a fruitless endeavour?
#5
@
9 years ago
Yeah, I usually stay away from line breaks in attributes, but thought the title became clearer in this case. One could also use a line feed entity
to keep the source output prettier, if that's a concern.
The spec mentions them and also advice caution: https://html.spec.whatwg.org/multipage/dom.html#the-title-attribute
A quick test shows that a title with enough lines will spill outside the screen in Firefox, while Chrome starts to position the tooltip towards the top if needed, so there's that as well.
In the end, removing it would probably be fine, since it's pretty much an inaccessible, mouse-only attribute (?).
#6
@
9 years ago
From an accessibility perspective, these titles don't really provide a lot of information, since they're available to such a small subset of users.
What would probably be the most useful thing to do here for accessibility would be to remove the title attribute entirely, and add an aria-label attribute with text like "Posts published on {date}". I'm not sure that having the complete list of titles serves any purpose; but knowing the general context of the link would definitely be valuable.
Patch after removing unnecessary variable