function t() is being used to translate user submitted text

unknownguy - August 27, 2008 - 23:30
Project:Node Relativity
Version:5.x-2.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Hello,

I have detected that some user submitted strings where being inserted into locales_source table.

Upon investigation I have found (using debug_backtrace() in the function locale), I have found that this module is the culprit. Look at the following lines:

...
1491             $children_box .= l(t($child_node->title), 'node/'.$child_node->nid, array('class' => 'relativity_view_' . $childtype)) . "<br />\n";
...
1639   $output .= node_get_types('name',$ancestor->type) . ': ' . l(t($ancestor->title), 'node/'.$ancestor->        nid, array('class' => 'relativity_view_' . $type));

(maybe there are more places in the .module...)

Is this a bug? I guess it is.

#1

unknownguy - August 28, 2008 - 07:44
Title:function t() is being using to translate user submitted text» function t() is being used to translate user submitted text

#2

janusman - March 25, 2009 - 00:11
Status:active» needs review

Patch included

AttachmentSize
relativity-300834.patch 1.23 KB

#3

janusman - March 25, 2009 - 00:17
Version:5.x-2.1» 5.x-2.3

Sorry, missed one t().. and this is for 5.x-2.3

AttachmentSize
relativity-300834-2.patch 2.09 KB

#4

dereine - August 19, 2009 - 15:54
Status:needs review» reviewed & tested by the community

Patch works fine on DRUPAL5 version.

Here is a patch which applies clean to drupal5.

Set to "rtbc" for DRUPAL-5 Version.

AttachmentSize
relativity-300834-drupal6.patch 2.17 KB

#5

tacituseu - August 20, 2009 - 19:05
Status:reviewed & tested by the community» needs work

You meant D6 ? it's already fixed in D5. And it should use check_plain().

 
 

Drupal is a registered trademark of Dries Buytaert.