Opened 9 years ago

Closed 8 years ago

#6279 closed Bug (invalid)

fckeditor_php5.php causing error in mediawiki's dumpBackup.php

Reported by: James Owned by:
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version:
Keywords: HasPatch Cc: jcuzella@…

Description

This bug was originally reported as 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.

Attachments (1)

6279.patch (599 bytes) - added by James 9 years ago.
Patch to fix problem. Based of of SVN r5862

Download all attachments as: .zip

Change History (6)

Changed 9 years ago by James

Attachment: 6279.patch added

Patch to fix problem. Based of of SVN r5862

comment:1 Changed 9 years ago by James

Keywords: HasPatch added

comment:2 Changed 9 years ago by James

Component: GeneralProject : MediaWiki+FCKeditor

comment:3 Changed 9 years ago by James

Cc: jcuzella@… added

comment:4 Changed 9 years ago by ccc123

after adding lines:

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

}

tried to enable fckeditor from mediawiki, it gave error:

Not Found

The requested URL /mediawiki/null/FCKeditor.popup.html was not found on this server.

comment:5 Changed 8 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

MediaWiki and FCKeditor are no longer supported. Closing the ticket.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy