﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
6279	fckeditor_php5.php causing error in mediawiki's dumpBackup.php	James		"This bug was originally reported as [https://bugzilla.wikimedia.org/show_bug.cgi?id=20810 Bug 20810] at bugzilla.wikimedia.org by Brian.

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.

Brian fixed the problem by adding the following to fckeditor_php5.php, but I believe this workaround has potential to break:
{{{
function FCKeditor_IsCompatibleBrowser()
{
    $sAgent = """";
    if (isset($_SERVER)) {
        if (isset$_SERVER['HTTP_USER_AGENT'])) {
            $sAgent = $_SERVER['HTTP_USER_AGENT'];
        }
     }
     else {
     ...
}}}


I see no reason for FCKeditor to be loaded when running command line php scripts for mediawiki maintenance.  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
}
}}}

I'm also submitting this as a proposed patch here."	Bug	closed	Normal		Project : MediaWiki+FCKeditor		invalid	HasPatch	jcuzella@…
