Extension talk:GeSHiHighlight (Ajqnic)

From MediaWiki.org
Jump to navigation Jump to search
The following discussion has been transferred from Meta-Wiki.
Any user names refer to users of that site, who are not necessarily users of MediaWiki.org (even if they share the same username).

patch needed[edit]

9 Sep 2006 - AjqNic: TobiasBengtsson patch to fix <php-file> support has been implemented in the 'official version'


I had to patch it to get it working with php file reading. You can find the patch as well as GeSHiHighlight in action here

--TobiasBengtsson 20:31, 14 January 2006 (UTC)


1.5.5 compatibility[edit]

8 Sep 2006 - AjqNic: Support for the $attrib parameter (required by MediaWiki 1.5 and above) has now been added to the 'official version'


We are running 1.5.5, and it seems the extension function now takes two parameters instead of just the text between the <lang></lang> tags. To get it to work I have had to modify the following lines:

 foreach ( $langArray as $lang ){
   $wgParser->setHook( $lang, create_function( '$text,$attrib', 'return wfSyntaxCode("' . $lang . '", $text);'));
   $wgParser->setHook( $lang.'-file', 
       create_function( '$file_name,$attrib', 'return wfSyntaxFile("' . $lang . '", $file_name);'));
 }

Note the new $attrib parameter in the create_function call.

--rassie 15:24, 26 January 2006 (GMT+1)


Security Alert[edit]

8 Sep 2006 - AjqNic: The 'official version' will now only allow for the display of files that have been uploaded (i.e. there is no longer a security risk as no server or config files may be viewed)


Hi, I installed your extension onto my webserver and tried - just for interest - the following:

<php-file>LocalSettings.php</php-file>

After that, I could read my configuration-settings - this is not good! So, on every wiki that has enabled this extension, everybody can read all files accessible to the web-server. I suggest to only allow files to be highlighted that are located in a certain directory!


minor bad effect when installing this extension[edit]

8 Sep 2006 - AjqNic: Support for 'div' code has now been removed from the 'official version' due to the tag conflicting with HTML div


You may remove or rename "div" of the $langArray... it makes strange behaviour when using div to format pages ! Bouil

I removed "div" in $langArray, and the strange behaviours disappeared for me too. However I still dont get the code highlighted. The rendering is different from <pre>. Its neat, clean and easy to read... i just dont get color yet. Any suggestions? -- Oblivious 15:03, 26 October 2005 (UTC)
Actually it works. All this time I've been trying without "geshi" directory inside "geshi" directory... stupid me. Thanks anyway. -- Oblivious 21:20, 26 October 2005 (UTC)


I can confirm that it works on MediaWiki 1.53 with PHP 5. Funnily enough, it didn't work (didn't colourise the text) when I first tried to get it to display the contents of GeSHiHighlight.php! The comment at the top of the script contains a </php> tag. I tried enclosing the text in an <nowiki> tag but that didn't work either. Anyway, little gotcha out of the way it seems to do exactly what it says on the tin. Thanks! --Kingboyk 05:27, 18 December 2005 (UTC)

m:User:Ajqnic:GeSHiHighlight/Cleaned-up-a-little-bit-version --Kingboyk 05:51, 18 December 2005 (UTC)

After the installation, all is fie except that when i enter a url with a new article, the actual message to edit this article is displayed in a new strange format (i means with no format)

is somebody with the same error ? Thx

PS: my config:

  1. MediaWiki: 1.6.5
  2. PHP: 5.1.4 (apache2handler)
  3. MySQL: 5.0.20a-standard


==> OK, i fix the pb by skipping the div section from lang array

Christophe