https://bugzilla.wikimedia.org/show_bug.cgi?id=16689

           Summary: wfDebugLog writes an error in Apache error.log
           Product: MediaWiki
           Version: 1.14-svn
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: API
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


wfDebugLog function's head (in includes/globalfunctions....@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 ?


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to