Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php |
— | — | @@ -52,9 +52,17 @@ |
53 | 53 | $wgExtensionMessagesFiles['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.i18n.php'; |
54 | 54 | $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = $dir . 'SyntaxHighlight_GeSHi.class.php'; |
55 | 55 | $wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook'; |
56 | | -$wgHooks['SpecialVersionExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi'; |
57 | 56 | $wgHooks['ParserFirstCallInit'][] = 'efSyntaxHighlight_GeSHiSetup'; |
58 | 57 | |
| 58 | +if ( version_compare( $wgVersion, '1.17alpha', '>=' ) ) { |
| 59 | + // For MediaWiki 1.17 alpha and later. |
| 60 | + $wgHooks['ExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi'; |
| 61 | +} |
| 62 | +else { |
| 63 | + // For pre-MediaWiki 1.17 alpha. |
| 64 | + $wgHooks['SpecialVersionExtensionTypes'][] = 'SyntaxHighlight_GeSHi::hOldSpecialVersion_GeSHi'; |
| 65 | +} |
| 66 | + |
59 | 67 | /** |
60 | 68 | * Register parser hook |
61 | 69 | */ |
Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php |
— | — | @@ -313,12 +313,20 @@ |
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
317 | | - * Get the GeSHI's version information while Special:Version is read |
| 317 | + * Get the GeSHI's version information while Special:Version is read. |
318 | 318 | */ |
319 | | - public static function hSpecialVersion_GeSHi( &$sp, &$extensionTypes ) { |
| 319 | + public static function hSpecialVersion_GeSHi( &$extensionTypes ) { |
320 | 320 | global $wgExtensionCredits; |
321 | 321 | self::initialise(); |
322 | 322 | $wgExtensionCredits['parserhook']['SyntaxHighlight_GeSHi']['version'] = GESHI_VERSION; |
323 | 323 | return true; |
324 | 324 | } |
325 | | -} |
| 325 | + |
| 326 | + /** |
| 327 | + * @see SyntaxHighlight_GeSHi::hSpecialVersion_GeSHi |
| 328 | + */ |
| 329 | + public static function hOldSpecialVersion_GeSHi( &$sp, &$extensionTypes ) { |
| 330 | + return self::hSpecialVersion_GeSHi( $extensionTypes ); |
| 331 | + } |
| 332 | + |
| 333 | +} |
\ No newline at end of file |