WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#27374 closed defect (bug) (fixed)

Notice in comments-template.php for HTTP_USER_AGENT

Reported by: joostdevalk Owned by: SergeyBiryukov
Milestone: 3.9 Priority: normal
Severity: normal Version: 0.71
Component: Comments Keywords: has-patch
Focuses: Cc:

Description

This generates a notice when the user agent isn't set, on line 947 of comment-template.php currently:

if ( false !== stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') )
	return;

Simply checking whether HTTP_USER_AGENT is set would fix it, of course.

Attachments (1)

comment-template.diff (587 bytes) - added by joostdevalk 6 years ago.
Comment Template Patch

Download all attachments as: .zip

Change History (6)

@joostdevalk
6 years ago

Comment Template Patch

#1 @SergeyBiryukov
6 years ago

  • Milestone changed from Awaiting Review to 3.9

Previously: #22979

#2 @SergeyBiryukov
6 years ago

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

In 27514:

Avoid a notice in trackback_rdf() if user agent is not set.

props joostdevalk.
fixes #27374.

#3 @SergeyBiryukov
6 years ago

  • Version changed from trunk to 0.71

#4 follow-up: @nacin
6 years ago

When is HTTP_USER_AGENT not set? CLI?

#5 in reply to: ↑ 4 @joostdevalk
6 years ago

Replying to nacin:

When is HTTP_USER_AGENT not set? CLI?

Could be lots of reasons really, CLI being one of them, but some people prefer to suppress that info as well...

Note: See TracTickets for help on using tickets.