Improper usage of t(), broken breadcrumbs

jtsnow - September 23, 2009 - 01:01
Project:OG Forum
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:paulbooker
Status:closed
Description

This module does not use the t() function properly. This is particularly a problem in the _og_forum_set_breadcrumb() function because it causes the group node's title to be escaped twice. This causes titles that contain special characters such as apostrophes and ampersands to look like a mess.

Only literal strings should be translated. Strings that are completely dynamic, such as $node->title, should not be translated. The attached patch fixes the problem in _og_forum_set_breadcrumb(). I have not reviewed the rest of the module to see if there are additional instances where t() is not used properly.

See http://api.drupal.org/api/function/t/6 for more information.

AttachmentSize
og_forum-fix-breadcrumbs.patch1.49 KB

#1

paulbooker - September 29, 2009 - 15:38

Thanks for the heads up.

Would someone like to go through the module and check for other occurrences ?

Best, Paul

#2

paulbooker - October 14, 2009 - 13:47
Assigned to:Anonymous» paulbooker
Status:needs review» reviewed & tested by the community

This patch and a couple of other related fixes will be committed shortly.

Thanks for the heads up!

Best, Paul

#3

paulbooker - October 14, 2009 - 13:48
Status:reviewed & tested by the community» fixed

#4

System Message - October 28, 2009 - 13:50
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.