[dev] Fwd: Horde Bug

Hans Lellelid hans at appliedsec.com
Fri Apr 4 07:49:05 PST 2003


> Hey, I just wanted to report a bug and I couldn't find a way 
> to submit a bug request without a login.
> 
> In Horde::logMessage, $logger is a static variable but when 
> it gets instantiated, the logger is being instantiated and 
> saved as a reference. You cannot save a reference into a 
> static variable because static variables are references themselves.
> 
>             $logger = &Log::singleton($conf['log']['type'],
> $conf['log']['name'],
>                                       $conf['log']['ident'], 
> $conf['log']['params']);
> 
>             should be
> 
>             $logger = Log::singleton($conf['log']['type'],
> $conf['log']['name'],
>                                       $conf['log']['ident'], 
> $conf['log']['params']);
> 

While it's true that this $logger var is being set multiple times, it
will _not_ work to set $logger = Log::singleton() because of the way
that the Log class uses attached log listeners -- which get detached
with the clone [IIRC].  I saw this 'bug' and made the change above to my
local copy of Horde, with the effect that sure $logger was only being
set once, but nothing was being logged anymore.

Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3549 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20030404/6f242366/smime-0001.bin


More information about the dev mailing list