#4390 closed defect (bug) (fixed)
trackback_rdf() bug
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.2.1 | Priority: | normal |
Severity: | major | Version: | 2.2 |
Component: | Template | Keywords: | |
Focuses: | 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.
Additional: This bug was introduced in [4990] for ticket #3920.