mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-14 18:15:57 +00:00
Use RejectParserCacheValue hook to invalidate caches that were using GeSHi
Change-Id: I47de88dc1c2f2380e41e6af0d3222b46c9c65569
This commit is contained in:
parent
139f68c410
commit
01802ac3fb
|
@ -378,6 +378,24 @@ class SyntaxHighlight_GeSHi {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reject parser cache values that are for GeSHi since those
|
||||
* ResourceLoader modules no longer exist
|
||||
*
|
||||
* @param ParserOutput $parserOutput
|
||||
* @param WikiPage $page
|
||||
* @param ParserOptions $popts
|
||||
* @return bool
|
||||
*/
|
||||
public static function onRejectParserCacheValue( ParserOutput $parserOutput, WikiPage $page, ParserOptions $popts ) {
|
||||
foreach ( $parserOutput->getModuleStyles() as $module ) {
|
||||
if ( strpos( $module, 'ext.geshi.' ) === 0 ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Backward-compatibility shim for extensions. */
|
||||
public static function prepare( $text, $lang ) {
|
||||
wfDeprecated( __METHOD__ );
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
],
|
||||
"ApiFormatHighlight": [
|
||||
"SyntaxHighlight_GeSHi::onApiFormatHighlight"
|
||||
],
|
||||
"RejectParserCacheValue": [
|
||||
"SyntaxHighlight_GeSHi::onRejectParserCacheValue"
|
||||
]
|
||||
},
|
||||
"SyntaxHighlightModels": {
|
||||
|
|
Loading…
Reference in a new issue