Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#4390 closed defect (bug) (fixed)

trackback_rdf() bug

Reported by: Otto42 Owned by: rob1n
Milestone: 2.2.1 Priority: normal
Severity: major Version: 2.2
Component: Template Keywords:
Focuses: Cc:


Line 242 of comments-template.php:

if (strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false) {

Should be this:

if (!stristr($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) {

Purpose of this code appears to be to not output the rdf code if the W3C validator is the one looking. But it's doing the opposite:

If the validator is looking at the code, the user agent will have the validator string in it. So strpos($_SERVERHTTP_USER_AGENT?, 'W3C_Validator') will return a number, which is !== false, meaning that statement is true, meaning that it outputs the RDF code. This is the reverse of the intended outcome.

The original code also has the problem of case sensitivity, which cannot be assured always. If we do want to be case sensitive, then the statement should be this:

if (strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') == false) {

Bug has been noted in these forum threads:

Suggest fix be made to both trunk and 2.2.whatever_is_next.

Change History (6)

#1 @Otto42
14 years ago

Additional: This bug was introduced in [4990] for ticket #3920.

#2 @rob1n
14 years ago

  • Owner changed from anonymous to rob1n
  • Status changed from new to assigned

#3 @rob1n
14 years ago

  • Milestone changed from 2.3 to 2.2.1
  • Version changed from 2.2.1 to 2.2

#4 @rob1n
14 years ago

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

(In [5626]) Fix a strpos typo. fixes #4390

#5 @markjaquith
14 years ago

(In [6039]) Deprecate option_can_override, option_type, option_width, option_height, option_description, option_admin_level from options table. Props Nazgul. fixes #4390

#6 @markjaquith
14 years ago

Dangit -- That last message was for #4398

Note: See TracTickets for help on using tickets.