Last modified: 2011-03-12 15:34:47 UTC
wfDebugLog function's head (in includes/GlobalFunctions.php@261) looks like this : ... function wfDebugLog( $logGroup, $text, $public = true ) { global $wgDebugLogGroups, $wgShowHostnames; if( $text{$textlen - 1} != "\n" ) $text .= "\n"; ... if $textlen length is 0 you get an error in Apache's error.log claiming -1 is not a legal index value, which is right. So I patched the file to add missing control so I got : ... function wfDebugLog( $logGroup, $text, $public = true ) { global $wgDebugLogGroups, $wgShowHostnames; $textlen = strlen( $text ); if( $textlen > 0 && $text{$textlen - 1} != "\n" ) $text .= "\n"; ... And this incredibly smart piece of code does work and I don't get errors anymore ! Am I mistaken ?
Should probably just do a trim() here...
Fixed in r44830
Seems to work. Is it my responsibility to mark this entry as closed ?
Actually we tend not to CLOSE things, but leave them as RESOLVED FIXED. But you can CLOSE it if you like to confirm the fix. :)