Am 12.02.2008 um 03:19 schrieb Marshall Pierce:

Samuel Kerschbaumer wrote:
Hello.

I think there is a bug in the LoggerDatePatternConverter::convert () method.
In this method there is a call to ereg_replace("[^\\]u",
sprintf(',%03d', $usecs), which should be like ereg_replace("[^\\\ \]u",
sprintf(',%03d', $usecs) instead.
The reason is that there are two quoting mechanisms in effect: The
quoting in a PHP string and the quoting of the regexp library.
Strangely the actual call works with some of my PHP installations,
whereas it causes trouble on others.

Could this be fixed?

Samuel

This handling of escaping 'u' to '\u' seems entirely unnecessary since
php's date() already lets you escape anything you want with a '\'. Try
deleting the extra stuff and have the method simply return the output of
date() on the date format and timestamp.

-Marshall

Hmm I think the purpose of this code was to support 'u' for the milliseconds in the date format, since date() supports u only since PHP 5.2.2. Since Log4PHP now focus only on PHP5 support these lines are unnecessary and should be removed.

Samuel

Reply via email to