Last modified: 2011-03-12 15:34:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T18689, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16689 - wfDebugLog writes an error in Apache error.log
wfDebugLog writes an error in Apache error.log
Status: CLOSED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
1.14.x
PC Windows XP
: Normal enhancement (vote)
: ---
Assigned To: Aaron Schulz
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-17 13:31 UTC by Etienne Massip
Modified: 2011-03-12 15:34 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Etienne Massip 2008-12-17 13:31:11 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 ?
Comment 1 Brion Vibber 2008-12-20 00:48:28 UTC
Should probably just do a trim() here...
Comment 2 Aaron Schulz 2008-12-20 02:19:46 UTC
Fixed in r44830
Comment 3 Etienne Massip 2009-01-05 09:20:08 UTC
Seems to work. Is it my responsibility to mark this entry as closed ?
Comment 4 Brion Vibber 2009-01-05 18:53:22 UTC
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. :)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links