diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php index 8c90341c..0401feca 100644 --- a/SyntaxHighlight_GeSHi.class.php +++ b/SyntaxHighlight_GeSHi.class.php @@ -313,12 +313,20 @@ class SyntaxHighlight_GeSHi { } /** - * Get the GeSHI's version information while Special:Version is read + * Get the GeSHI's version information while Special:Version is read. */ - public static function hSpecialVersion_GeSHi( &$sp, &$extensionTypes ) { + public static function hSpecialVersion_GeSHi( &$extensionTypes ) { global $wgExtensionCredits; self::initialise(); $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION; return true; } -} + + /** + * @see SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi + */ + public static function hOldSpecialVersion_GeSHi( &$sp, &$extensionTypes ) { + return self::hSpecialVersion_GeSHi( $extensionTypes ); + } + +} \ No newline at end of file diff --git a/SyntaxHighlight_GeSHi.php b/SyntaxHighlight_GeSHi.php index ab6334a7..cb64731f 100644 --- a/SyntaxHighlight_GeSHi.php +++ b/SyntaxHighlight_GeSHi.php @@ -52,9 +52,17 @@ $dir = dirname(__FILE__) . '/'; $wgExtensionMessagesFiles['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.i18n.php'; $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.class.php'; $wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook'; -$wgHooks['SpecialVersionExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi'; $wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup'; +if ( version_compare( $wgVersion, '1.17alpha', '>=' ) ) { + // For MediaWiki 1.17 alpha and later. + $wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi'; +} +else { + // For pre-MediaWiki 1.17 alpha. + $wgHooks['SpecialVersionExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hOldSpecialVersion_GeSHi'; +} + /** * Register parser hook */