t() function can't be invoked in hook_boot() - patch supplied

greg.harvey - October 24, 2008 - 13:32
Project:Shared Sign-On
Version:6.x-1.3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Please find attached a patch to fix the issue where a PHP fatal error is caused by line 170 of this module if someone attempts a hack. The developer attempts to wrap the message in the t() function, but it cannot be guaranteed available as the bootstrap order is arbitrary. If it is not available, a fatal error is caused. Easiest fix, don't wrap it in the t() function! =)

AttachmentSize
singlesignon_boot_t_patch-20081024.patch526 bytes

#1

greg.harvey - October 24, 2008 - 14:36

Actually, correction - t() is core, so bootstrap is not the issue - rather using hook_boot() as opposed to hook_init(). Totally get why you do that, you *MUST* use hook_boot() but it means t() is not available because nothing has been initialised at that point.

#2

greg.harvey - October 24, 2008 - 17:08
Title:t() function can't be invoked on a hack attempt» t() function can't be invoked in hook_boot() - patch supplied
Status:active» needs review

#3

tayzlor - January 14, 2009 - 13:16

and this, can it be reviewed / applied?

 
 

Drupal is a registered trademark of Dries Buytaert.