Ticket #4390 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

trackback_rdf() bug

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

Description

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:
http://wordpress.org/support/topic/118168
http://wordpress.org/support/topic/119698

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

Change History

06/01/07 17:15:17 changed by Otto42

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

06/01/07 20:06:26 changed by rob1n

  • owner changed from anonymous to rob1n.
  • status changed from new to assigned.

06/01/07 23:07:37 changed by rob1n

  • version changed from 2.2.1 to 2.2.
  • milestone changed from 2.3 to 2.2.1.

06/01/07 23:10:03 changed by rob1n

  • status changed from assigned to closed.
  • resolution set to fixed.

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

09/05/07 19:20:53 changed by markjaquith

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

09/05/07 19:23:27 changed by markjaquith

Dangit -- That last message was for #4398