aboutsummaryrefslogtreecommitdiffstats
path: root/includes/parser/ParserCacheFactory.php
diff options
context:
space:
mode:
authorPetr Pchelko <ppchelko@wikimedia.org>2020-10-22 17:17:31 -0700
committerPetr Pchelko <ppchelko@wikimedia.org>2020-11-10 11:21:09 -0700
commit7c68ae929615e31b17a7013d169fa020fabeefd1 (patch)
tree902708c2667f488e86009e7bc7451c7ca2dca687 /includes/parser/ParserCacheFactory.php
parent5072cb83b170ccee5e5b760e86a477d03c2cbd74 (diff)
downloadmediawikicore-7c68ae929615e31b17a7013d169fa020fabeefd1.tar.gz
mediawikicore-7c68ae929615e31b17a7013d169fa020fabeefd1.zip
Safe ParserOutput extension data and JsonUnserializable helper.
One major difference with what we've had before is that now we actually write class names into the serialization - given that this new mechanism is extencible, we can't establish any kind of mapping of allowed classes. I do not think it's a problem though. Bug: T264394 Change-Id: Ia152f3b76b967aabde2d8a182e3aec7d3002e5ea
Diffstat (limited to 'includes/parser/ParserCacheFactory.php')
-rw-r--r--includes/parser/ParserCacheFactory.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/parser/ParserCacheFactory.php b/includes/parser/ParserCacheFactory.php
index 12703d933be0..427e3ba80dc5 100644
--- a/includes/parser/ParserCacheFactory.php
+++ b/includes/parser/ParserCacheFactory.php
@@ -24,6 +24,7 @@ namespace MediaWiki\Parser;
use BagOStuff;
use IBufferingStatsdDataFactory;
use MediaWiki\HookContainer\HookContainer;
+use MediaWiki\Json\JsonUnserializer;
use ParserCache;
use Psr\Log\LoggerInterface;
@@ -46,6 +47,9 @@ class ParserCacheFactory {
/** @var HookContainer */
private $hookContainer;
+ /** @var JsonUnserializer */
+ private $jsonUnserializer;
+
/** @var IBufferingStatsdDataFactory */
private $stats;
@@ -65,6 +69,7 @@ class ParserCacheFactory {
* @param BagOStuff $cacheBackend
* @param string $cacheEpoch
* @param HookContainer $hookContainer
+ * @param JsonUnserializer $jsonUnserializer
* @param IBufferingStatsdDataFactory $stats
* @param LoggerInterface $logger
* @param bool $useJson Temporary feature flag, remove before 1.36 is released.
@@ -73,6 +78,7 @@ class ParserCacheFactory {
BagOStuff $cacheBackend,
string $cacheEpoch,
HookContainer $hookContainer,
+ JsonUnserializer $jsonUnserializer,
IBufferingStatsdDataFactory $stats,
LoggerInterface $logger,
$useJson = false
@@ -80,6 +86,7 @@ class ParserCacheFactory {
$this->cacheBackend = $cacheBackend;
$this->cacheEpoch = $cacheEpoch;
$this->hookContainer = $hookContainer;
+ $this->jsonUnserializer = $jsonUnserializer;
$this->stats = $stats;
$this->logger = $logger;
$this->useJson = $useJson;
@@ -98,6 +105,7 @@ class ParserCacheFactory {
$this->cacheBackend,
$this->cacheEpoch,
$this->hookContainer,
+ $this->jsonUnserializer,
$this->stats,
$this->logger,
$this->useJson