Page MenuHomePhabricator

FCKeditor causing notices in maintenance scripts
Closed, DeclinedPublic

Description

Author: blarkin

Description:
I am running PHP 5.2.10 on IIS 6 on Windows Server 2003 but I believe it would affect anyone. The following bug was found while working with Mediawiki v1.15.1. If you attempt to run mediawiki's dumpBackup.php job, it generates the following error:

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

The file in question attempts to access $_SERVER['HTTP_USER_AGENT'] without checking to see if it is set. To work around this, I modified fckeditor_php5.php to:

<code>
function FCKeditor_IsCompatibleBrowser()
{

$sAgent = "";
if (isset($_SERVER)) {
    if (isset$_SERVER['HTTP_USER_AGENT'])) {
        $sAgent = $_SERVER['HTTP_USER_AGENT'];
    }
 }
 else {
 ...

</code>


Version: unspecified
Severity: enhancement

Details

Reference
bz20810

Related Objects

StatusSubtypeAssignedTask
InvalidNone
DeclinedNone

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:48 PM
bzimport set Reference to bz20810.
bzimport added a subscriber: Unknown Object (MLST).

jcuzella wrote:

I can verify this bug in MW 1.16 and PHP 5.3.2. The work-around here looks like it fixes the immediate problem, but I'm wondering why FCKeditor should even be included in command line mode?

I think a better solution would be to avoid even loading the extension if $wgCommandLineMode is set. I've added the following to the top of my extensions\FCKeditor\FCKeditor.php file:

There is no real reason for FCKeditor to run in commandline mode!
This avoids breakage of scripts like dumpBackup.php
if ( isset($wgCommandLineMode) && $wgCommandLineMode )
{
return; // Simply return from the include, so no FCKeditor code is run
}

jcuzella wrote:

Ported bug to upstream tracker: https://dev.ckeditor.com/ticket/6279

Patch added there.

  • Bug 25211 has been marked as a duplicate of this bug. ***

Comment by j.swiderski in upstream bug reports http://dev.ckeditor.com/ticket/5602 and https://dev.ckeditor.com/ticket/6279 :
"FCKeditor and MediaWiki are no longer supported. Closing the ticked as
invalid."