Download & Extend

token_user.inc overrides the value of $account->name which have side effects on anonymous comment authors

Project:Token
Version:6.x-1.18
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Since I have updated to token-6.x-1.18 all anonymous comments appear with "Anonymous" user in spite of users writing a value in the comment form .

It seems that this value is being changed on token_user.inc where it does:

<?php
   
if (!$account->uid && empty($account->name)) {
     
$account->name = variable_get('anonymous', 'Anonymous');
    }
?>

Commenting out that assignation the comment author is correctly filled.

Comments

#1

This patch makes token_user.inc not to override $account->name.

AttachmentSizeStatusTest resultOperations
1344766-1.patch800 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 200 pass(es).View details

#2

Priority:normal» major

Ah thanks this definitely needs to be fixed.

#3

Status:active» needs review

#4

Status:needs review» fixed

Thanks, committed this to 6.x-1.x-dev: http://drupalcode.org/project/token.git/commit/8b88af7

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.