Extension talk:Java Applet/LQT Archive 1

From mediawiki.org


I believe this extension has problems.

I tried it and get the following error :

    Warning: Cannot modify header information - headers already sent by (output started at /mnt/150/.../wiki/extensions/JavaApplet.php:66) in /mnt/150/.../wiki/includes/WebResponse.php on line 10

How to fix it?

-> I get it, I had to remove additional space after the ?> tag of JavaApplet.php


I changed str_replace with str_ireplace for jars with mismatching type on cases/jar names

Making it work on MediaWiki 1.20.3[edit]

This extension crashes on MediaWiki 1.20.3 with the following message in the webserver's error log:

  PHP Fatal error:  Class 'Image' not found in /var/www/mediawiki/extensions/JavaApplet.php on line 27

A fix for a similar problem has been made for Extension:FreeMind, see FreeMind returns "File Not Found" error in mw v.1.18+.

Replace the part:

        // Get the Image object from the file name
        $file = Image::newFromName( $appletBinary ) ; // Need to check this better

with:

        // Get the image object from the file name
        $file = wfFindFile( $appletBinary ) ;
        if ($file == false)
                return "\n<!-- JavaApplet.php: Applet not found -->";

The last two lines also add simple detection of bad filenames.