mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-15 02:24:07 +00:00
Don't overwrite existing value of $wgSyntaxHighlightModels
Currently extensions that want to add their model to $wgSyntaxHighlightModels must do so in an extension function since they don't want to assume that their extension is loaded after SyntaxHighlight GeSHi is. But by not overwriting the array during initialization, extensions don't have to worry about load order. Also require a minimum of MW 1.24 which removed support for register_globals. Change-Id: I15c56690d156e90991aa86a3d79dbeaeb18dd6fd
This commit is contained in:
parent
46e2435b9d
commit
f798181948
|
@ -36,6 +36,11 @@ if( !defined( 'MEDIAWIKI' ) ) {
|
|||
die();
|
||||
}
|
||||
|
||||
if ( version_compare( $wgVersion, '1.24', '<' ) ) {
|
||||
die( "This version of SyntaxHighlight GeSHi requires MediaWiki 1.24" );
|
||||
}
|
||||
|
||||
|
||||
$wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi'] = array(
|
||||
'path' => __FILE__,
|
||||
'name' => 'SyntaxHighlight',
|
||||
|
@ -70,10 +75,8 @@ $wgResourceModules['ext.geshi.local'] = array( 'class' => 'ResourceLoaderGeSHiLo
|
|||
* Map content models to the corresponding language names to be used with the highlighter.
|
||||
* Pages with one of the given content models will automatically be highlighted.
|
||||
*/
|
||||
$wgSyntaxHighlightModels = array(
|
||||
CONTENT_MODEL_CSS => 'css',
|
||||
CONTENT_MODEL_JAVASCRIPT => 'javascript',
|
||||
);
|
||||
$wgSyntaxHighlightModels[CONTENT_MODEL_CSS] = 'css';
|
||||
$wgSyntaxHighlightModels[CONTENT_MODEL_JAVASCRIPT] = 'javascript';
|
||||
|
||||
/**
|
||||
* Register parser hook
|
||||
|
|
Loading…
Reference in a new issue