I have a block from Revisioning that has a link as it's heading:

4 revisions pending

When this block is put into the tray, I end up with

4 revisions pending" class="tray-item-handle">Open

This happens because tray.module simply concatenates $block->subject into the html without any consideration for the fact that the subject might contain quotes (... does this make it a security issue? I'll leave you to decide that).

Adding an invocation of strip_tags() around $block->subject does the trick for me.

Regards,

Nigel

Comments

rajarju’s picture

Assigned: Unassigned » rajarju
Status: Active » Fixed

Hi,
Iv added strip_tags() added committed to head.
Cheers

nigelcunningham’s picture

Status: Fixed » Closed (fixed)

Thanks!

GolDRoger’s picture

Can u explain to me what have u done for correcting this? I have the same problem but with User notifications it reports me * Your Notifications") class="tray-item-handle">Open

and I don't have understood where to put this strip_tags()

thx

GolDRoger’s picture

FIXED :D

after several try i discovered how to do that. So if anyone is giving strange errors when putting blocks in Tray change this line in:

 $output .= '<a href="#" title="' .strip_tags($block->subject). '" class="tray-item-handle">' .t(strip_tags($block->subject)). '</a>';  $output .= '<div class="tray-item-block">';

And the error will be fixed :)