The substitution of the email variables doesn't work

fl3a - May 6, 2009 - 13:14
Project:abuse
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

The substitution of the email variables doesn't work.
In abuse_admin_moderate_content(), in abuse.admin.inc at the t-function for the description of the body-fields, eg. line 592 it is mentioned to use the schema !variable

'#description' => t('available fields are !title, !url, !name, and !id. You can copy from the list below.'),

but in abuse_mail() where the substitution should happen via strtr(), the array keys were written with @variable

...
$vars = array(
    '@title' => $object->title,
    '@url' => $object->link,
    '@name' => $account->name,
    '@id' => $object->link,
  );
  ...
  $body = strtr($params['body'], $vars);

so no substitution takes place.

In case of a flagged comment i received in the abuse-mail a node/683#comment-21 when i used @url instead of !url, perhaps it should be absolute with a leading http://.

See attached patch which solve both cases.

AttachmentSize
abuse.admin_.inc-abuse_mail.patch768 bytes
 
 

Drupal is a registered trademark of Dries Buytaert.