X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FWikiPage.php;h=5c7c7fef3b89ab15c0c3e85b30b1760b47e195ed;hb=be42e09aa866d7def54ead06c91d5dc9c8210ce5;hp=2adc5fbc105017777359e89facf05f1752bb9a52;hpb=afdb4753bdcbc55608e350195d3e8de49e6fdfff;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 2adc5fbc10..5c7c7fef3b 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1055,6 +1055,13 @@ class WikiPage implements Page, IDBAccessObject { ) { $useParserCache = ( !$forceParse ) && $this->shouldCheckParserCache( $parserOptions, $oldid ); + + if ( $useParserCache && !$parserOptions->isSafeToCache() ) { + throw new InvalidArgumentException( + 'The supplied ParserOptions are not safe to cache. Fix the options or set $forceParse = true.' + ); + } + wfDebug( __METHOD__ . ': using parser cache: ' . ( $useParserCache ? 'yes' : 'no' ) . "\n" ); if ( $parserOptions->getStubThreshold() ) { @@ -3327,7 +3334,7 @@ class WikiPage implements Page, IDBAccessObject { HTMLFileCache::clearFileCache( $title ); $revid = $revision ? $revision->getId() : null; - DeferredUpdates::addCallableUpdate( function() use ( $title, $revid ) { + DeferredUpdates::addCallableUpdate( function () use ( $title, $revid ) { InfoAction::invalidateCache( $title, $revid ); } ); }