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

       Web browser: ---
             Bug #: 32322
           Summary: Undefined index "HTTP_USER_AGENT" causes PHP notice in
                    maintenance scripts
           Product: MediaWiki extensions
           Version: any
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: FCKeditor
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


Having FCKeditor installed, I get the following notice when I run the
maintenance scripts:

Notice: Undefined index: HTTP_USER_AGENT in
extensions\FCKeditor\fckeditor\fckeditor_php5.php on line 37

The file in question attempts to access $_SERVER['HTTP_USER_AGENT'] which is
not set in command line mode.

People have already asked for a fix in CKEditor itself, however the CKEditor
guys say they will not fix this issue. See http://dev.ckeditor.com/ticket/6279

I see no reason for FCKeditor to be loaded when running command line php
scripts for mediawiki maintenance. 
I propose to fix the issue in the MediaWiki extension by adding an early
return, if we are in command line mode:

At the beginning of FCKeditor\FCKeditor.php:
<code>
// There is no reason for FCKeditor to run in commandline mode.
// Returning avoids breakage of scripts like dumpBackup.php.
if ( isset($wgCommandLineMode) && $wgCommandLineMode )
{
    return; // Simply return from the include, so no FCKeditor code is run
}
</code>

I am running MediaWiki 1.17 and the according released version of FCKeditor.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
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