MediaWiki REL1_30
ApiQueryRevisionsBase.php
Go to the documentation of this file.
1<?php
33
36
37 protected $fld_ids = false, $fld_flags = false, $fld_timestamp = false,
38 $fld_size = false, $fld_sha1 = false, $fld_comment = false,
39 $fld_parsedcomment = false, $fld_user = false, $fld_userid = false,
40 $fld_content = false, $fld_tags = false, $fld_contentmodel = false, $fld_parsetree = false;
41
42 public function execute() {
43 $this->run();
44 }
45
46 public function executeGenerator( $resultPageSet ) {
47 $this->run( $resultPageSet );
48 }
49
54 abstract protected function run( ApiPageSet $resultPageSet = null );
55
61 protected function parseParameters( $params ) {
62 if ( !is_null( $params['difftotext'] ) ) {
63 $this->difftotext = $params['difftotext'];
64 $this->difftotextpst = $params['difftotextpst'];
65 } elseif ( !is_null( $params['diffto'] ) ) {
66 if ( $params['diffto'] == 'cur' ) {
67 $params['diffto'] = 0;
68 }
69 if ( ( !ctype_digit( $params['diffto'] ) || $params['diffto'] < 0 )
70 && $params['diffto'] != 'prev' && $params['diffto'] != 'next'
71 ) {
72 $p = $this->getModulePrefix();
73 $this->dieWithError( [ 'apierror-baddiffto', $p ], 'diffto' );
74 }
75 // Check whether the revision exists and is readable,
76 // DifferenceEngine returns a rather ambiguous empty
77 // string if that's not the case
78 if ( $params['diffto'] != 0 ) {
79 $difftoRev = Revision::newFromId( $params['diffto'] );
80 if ( !$difftoRev ) {
81 $this->dieWithError( [ 'apierror-nosuchrevid', $params['diffto'] ] );
82 }
83 if ( !$difftoRev->userCan( Revision::DELETED_TEXT, $this->getUser() ) ) {
84 $this->addWarning( [ 'apiwarn-difftohidden', $difftoRev->getId() ] );
85 $params['diffto'] = null;
86 }
87 }
88 $this->diffto = $params['diffto'];
89 }
90
91 $prop = array_flip( $params['prop'] );
92
93 $this->fld_ids = isset( $prop['ids'] );
94 $this->fld_flags = isset( $prop['flags'] );
95 $this->fld_timestamp = isset( $prop['timestamp'] );
96 $this->fld_comment = isset( $prop['comment'] );
97 $this->fld_parsedcomment = isset( $prop['parsedcomment'] );
98 $this->fld_size = isset( $prop['size'] );
99 $this->fld_sha1 = isset( $prop['sha1'] );
100 $this->fld_content = isset( $prop['content'] );
101 $this->fld_contentmodel = isset( $prop['contentmodel'] );
102 $this->fld_userid = isset( $prop['userid'] );
103 $this->fld_user = isset( $prop['user'] );
104 $this->fld_tags = isset( $prop['tags'] );
105 $this->fld_parsetree = isset( $prop['parsetree'] );
106
107 if ( $this->fld_parsetree ) {
108 $encParam = $this->encodeParamName( 'prop' );
109 $name = $this->getModuleName();
110 $parent = $this->getParent();
111 $parentParam = $parent->encodeParamName( $parent->getModuleManager()->getModuleGroup( $name ) );
112 $this->addDeprecation(
113 [ 'apiwarn-deprecation-parameter', "{$encParam}=parsetree" ],
114 "action=query&{$parentParam}={$name}&{$encParam}=parsetree"
115 );
116 }
117
118 if ( !empty( $params['contentformat'] ) ) {
119 $this->contentFormat = $params['contentformat'];
120 }
121
122 $this->limit = $params['limit'];
123
124 $this->fetchContent = $this->fld_content || !is_null( $this->diffto )
125 || !is_null( $this->difftotext ) || $this->fld_parsetree;
126
127 $smallLimit = false;
128 if ( $this->fetchContent ) {
129 $smallLimit = true;
130 $this->expandTemplates = $params['expandtemplates'];
131 $this->generateXML = $params['generatexml'];
132 $this->parseContent = $params['parse'];
133 if ( $this->parseContent ) {
134 // Must manually initialize unset limit
135 if ( is_null( $this->limit ) ) {
136 $this->limit = 1;
137 }
138 }
139 if ( isset( $params['section'] ) ) {
140 $this->section = $params['section'];
141 } else {
142 $this->section = false;
143 }
144 }
145
146 $userMax = $this->parseContent ? 1 : ( $smallLimit ? ApiBase::LIMIT_SML1 : ApiBase::LIMIT_BIG1 );
147 $botMax = $this->parseContent ? 1 : ( $smallLimit ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_BIG2 );
148 if ( $this->limit == 'max' ) {
149 $this->limit = $this->getMain()->canApiHighLimits() ? $botMax : $userMax;
150 if ( $this->setParsedLimit ) {
151 $this->getResult()->addParsedLimit( $this->getModuleName(), $this->limit );
152 }
153 }
154
155 if ( is_null( $this->limit ) ) {
156 $this->limit = 10;
157 }
158 $this->validateLimit( 'limit', $this->limit, 1, $userMax, $botMax );
159 }
160
168 protected function extractRevisionInfo( Revision $revision, $row ) {
169 $title = $revision->getTitle();
170 $user = $this->getUser();
171 $vals = [];
172 $anyHidden = false;
173
174 if ( $this->fld_ids ) {
175 $vals['revid'] = intval( $revision->getId() );
176 if ( !is_null( $revision->getParentId() ) ) {
177 $vals['parentid'] = intval( $revision->getParentId() );
178 }
179 }
180
181 if ( $this->fld_flags ) {
182 $vals['minor'] = $revision->isMinor();
183 }
184
185 if ( $this->fld_user || $this->fld_userid ) {
186 if ( $revision->isDeleted( Revision::DELETED_USER ) ) {
187 $vals['userhidden'] = true;
188 $anyHidden = true;
189 }
190 if ( $revision->userCan( Revision::DELETED_USER, $user ) ) {
191 if ( $this->fld_user ) {
192 $vals['user'] = $revision->getUserText( Revision::RAW );
193 }
194 $userid = $revision->getUser( Revision::RAW );
195 if ( !$userid ) {
196 $vals['anon'] = true;
197 }
198
199 if ( $this->fld_userid ) {
200 $vals['userid'] = $userid;
201 }
202 }
203 }
204
205 if ( $this->fld_timestamp ) {
206 $vals['timestamp'] = wfTimestamp( TS_ISO_8601, $revision->getTimestamp() );
207 }
208
209 if ( $this->fld_size ) {
210 if ( !is_null( $revision->getSize() ) ) {
211 $vals['size'] = intval( $revision->getSize() );
212 } else {
213 $vals['size'] = 0;
214 }
215 }
216
217 if ( $this->fld_sha1 ) {
218 if ( $revision->isDeleted( Revision::DELETED_TEXT ) ) {
219 $vals['sha1hidden'] = true;
220 $anyHidden = true;
221 }
222 if ( $revision->userCan( Revision::DELETED_TEXT, $user ) ) {
223 if ( $revision->getSha1() != '' ) {
224 $vals['sha1'] = Wikimedia\base_convert( $revision->getSha1(), 36, 16, 40 );
225 } else {
226 $vals['sha1'] = '';
227 }
228 }
229 }
230
231 if ( $this->fld_contentmodel ) {
232 $vals['contentmodel'] = $revision->getContentModel();
233 }
234
235 if ( $this->fld_comment || $this->fld_parsedcomment ) {
236 if ( $revision->isDeleted( Revision::DELETED_COMMENT ) ) {
237 $vals['commenthidden'] = true;
238 $anyHidden = true;
239 }
240 if ( $revision->userCan( Revision::DELETED_COMMENT, $user ) ) {
241 $comment = $revision->getComment( Revision::RAW );
242
243 if ( $this->fld_comment ) {
244 $vals['comment'] = $comment;
245 }
246
247 if ( $this->fld_parsedcomment ) {
248 $vals['parsedcomment'] = Linker::formatComment( $comment, $title );
249 }
250 }
251 }
252
253 if ( $this->fld_tags ) {
254 if ( $row->ts_tags ) {
255 $tags = explode( ',', $row->ts_tags );
256 ApiResult::setIndexedTagName( $tags, 'tag' );
257 $vals['tags'] = $tags;
258 } else {
259 $vals['tags'] = [];
260 }
261 }
262
263 $content = null;
264 global $wgParser;
265 if ( $this->fetchContent ) {
266 $content = $revision->getContent( Revision::FOR_THIS_USER, $this->getUser() );
267 // Expand templates after getting section content because
268 // template-added sections don't count and Parser::preprocess()
269 // will have less input
270 if ( $content && $this->section !== false ) {
271 $content = $content->getSection( $this->section, false );
272 if ( !$content ) {
273 $this->dieWithError(
274 [
275 'apierror-nosuchsection-what',
276 wfEscapeWikiText( $this->section ),
277 $this->msg( 'revid', $revision->getId() )
278 ],
279 'nosuchsection'
280 );
281 }
282 }
283 if ( $revision->isDeleted( Revision::DELETED_TEXT ) ) {
284 $vals['texthidden'] = true;
285 $anyHidden = true;
286 } elseif ( !$content ) {
287 $vals['textmissing'] = true;
288 }
289 }
290 if ( $this->fld_parsetree || ( $this->fld_content && $this->generateXML ) ) {
291 if ( $content ) {
292 if ( $content->getModel() === CONTENT_MODEL_WIKITEXT ) {
293 $t = $content->getNativeData(); # note: don't set $text
294
295 $wgParser->startExternalParse(
296 $title,
297 ParserOptions::newFromContext( $this->getContext() ),
298 Parser::OT_PREPROCESS
299 );
300 $dom = $wgParser->preprocessToDom( $t );
301 if ( is_callable( [ $dom, 'saveXML' ] ) ) {
302 $xml = $dom->saveXML();
303 } else {
304 $xml = $dom->__toString();
305 }
306 $vals['parsetree'] = $xml;
307 } else {
308 $vals['badcontentformatforparsetree'] = true;
309 $this->addWarning(
310 [
311 'apierror-parsetree-notwikitext-title',
312 wfEscapeWikiText( $title->getPrefixedText() ),
313 $content->getModel()
314 ],
315 'parsetree-notwikitext'
316 );
317 }
318 }
319 }
320
321 if ( $this->fld_content && $content ) {
322 $text = null;
323
324 if ( $this->expandTemplates && !$this->parseContent ) {
325 # XXX: implement template expansion for all content types in ContentHandler?
326 if ( $content->getModel() === CONTENT_MODEL_WIKITEXT ) {
327 $text = $content->getNativeData();
328
329 $text = $wgParser->preprocess(
330 $text,
331 $title,
332 ParserOptions::newFromContext( $this->getContext() )
333 );
334 } else {
335 $this->addWarning( [
336 'apierror-templateexpansion-notwikitext',
337 wfEscapeWikiText( $title->getPrefixedText() ),
338 $content->getModel()
339 ] );
340 $vals['badcontentformat'] = true;
341 $text = false;
342 }
343 }
344 if ( $this->parseContent ) {
345 $po = $content->getParserOutput(
346 $title,
347 $revision->getId(),
348 ParserOptions::newFromContext( $this->getContext() )
349 );
350 $text = $po->getText();
351 }
352
353 if ( $text === null ) {
354 $format = $this->contentFormat ?: $content->getDefaultFormat();
355 $model = $content->getModel();
356
357 if ( !$content->isSupportedFormat( $format ) ) {
358 $name = wfEscapeWikiText( $title->getPrefixedText() );
359 $this->addWarning( [ 'apierror-badformat', $this->contentFormat, $model, $name ] );
360 $vals['badcontentformat'] = true;
361 $text = false;
362 } else {
363 $text = $content->serialize( $format );
364 // always include format and model.
365 // Format is needed to deserialize, model is needed to interpret.
366 $vals['contentformat'] = $format;
367 $vals['contentmodel'] = $model;
368 }
369 }
370
371 if ( $text !== false ) {
372 ApiResult::setContentValue( $vals, 'content', $text );
373 }
374 }
375
376 if ( $content && ( !is_null( $this->diffto ) || !is_null( $this->difftotext ) ) ) {
377 static $n = 0; // Number of uncached diffs we've had
378
379 if ( $n < $this->getConfig()->get( 'APIMaxUncachedDiffs' ) ) {
380 $vals['diff'] = [];
381 $context = new DerivativeContext( $this->getContext() );
382 $context->setTitle( $title );
383 $handler = $revision->getContentHandler();
384
385 if ( !is_null( $this->difftotext ) ) {
386 $model = $title->getContentModel();
387
388 if ( $this->contentFormat
389 && !ContentHandler::getForModelID( $model )->isSupportedFormat( $this->contentFormat )
390 ) {
391 $name = wfEscapeWikiText( $title->getPrefixedText() );
392 $this->addWarning( [ 'apierror-badformat', $this->contentFormat, $model, $name ] );
393 $vals['diff']['badcontentformat'] = true;
394 $engine = null;
395 } else {
396 $difftocontent = ContentHandler::makeContent(
397 $this->difftotext,
398 $title,
399 $model,
400 $this->contentFormat
401 );
402
403 if ( $this->difftotextpst ) {
404 $popts = ParserOptions::newFromContext( $this->getContext() );
405 $difftocontent = $difftocontent->preSaveTransform( $title, $user, $popts );
406 }
407
408 $engine = $handler->createDifferenceEngine( $context );
409 $engine->setContent( $content, $difftocontent );
410 }
411 } else {
412 $engine = $handler->createDifferenceEngine( $context, $revision->getId(), $this->diffto );
413 $vals['diff']['from'] = $engine->getOldid();
414 $vals['diff']['to'] = $engine->getNewid();
415 }
416 if ( $engine ) {
417 $difftext = $engine->getDiffBody();
418 ApiResult::setContentValue( $vals['diff'], 'body', $difftext );
419 if ( !$engine->wasCacheHit() ) {
420 $n++;
421 }
422 }
423 } else {
424 $vals['diff']['notcached'] = true;
425 }
426 }
427
428 if ( $anyHidden && $revision->isDeleted( Revision::DELETED_RESTRICTED ) ) {
429 $vals['suppressed'] = true;
430 }
431
432 return $vals;
433 }
434
435 public function getCacheMode( $params ) {
436 if ( $this->userCanSeeRevDel() ) {
437 return 'private';
438 }
439
440 return 'public';
441 }
442
443 public function getAllowedParams() {
444 return [
445 'prop' => [
447 ApiBase::PARAM_DFLT => 'ids|timestamp|flags|comment|user',
449 'ids',
450 'flags',
451 'timestamp',
452 'user',
453 'userid',
454 'size',
455 'sha1',
456 'contentmodel',
457 'comment',
458 'parsedcomment',
459 'content',
460 'tags',
461 'parsetree',
462 ],
463 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-prop',
465 'ids' => 'apihelp-query+revisions+base-paramvalue-prop-ids',
466 'flags' => 'apihelp-query+revisions+base-paramvalue-prop-flags',
467 'timestamp' => 'apihelp-query+revisions+base-paramvalue-prop-timestamp',
468 'user' => 'apihelp-query+revisions+base-paramvalue-prop-user',
469 'userid' => 'apihelp-query+revisions+base-paramvalue-prop-userid',
470 'size' => 'apihelp-query+revisions+base-paramvalue-prop-size',
471 'sha1' => 'apihelp-query+revisions+base-paramvalue-prop-sha1',
472 'contentmodel' => 'apihelp-query+revisions+base-paramvalue-prop-contentmodel',
473 'comment' => 'apihelp-query+revisions+base-paramvalue-prop-comment',
474 'parsedcomment' => 'apihelp-query+revisions+base-paramvalue-prop-parsedcomment',
475 'content' => 'apihelp-query+revisions+base-paramvalue-prop-content',
476 'tags' => 'apihelp-query+revisions+base-paramvalue-prop-tags',
477 'parsetree' => [ 'apihelp-query+revisions+base-paramvalue-prop-parsetree',
479 ],
480 ],
481 'limit' => [
482 ApiBase::PARAM_TYPE => 'limit',
486 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-limit',
487 ],
488 'expandtemplates' => [
489 ApiBase::PARAM_DFLT => false,
490 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-expandtemplates',
492 ],
493 'generatexml' => [
494 ApiBase::PARAM_DFLT => false,
496 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-generatexml',
497 ],
498 'parse' => [
499 ApiBase::PARAM_DFLT => false,
500 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-parse',
502 ],
503 'section' => [
504 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-section',
505 ],
506 'diffto' => [
507 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-diffto',
509 ],
510 'difftotext' => [
511 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-difftotext',
513 ],
514 'difftotextpst' => [
515 ApiBase::PARAM_DFLT => false,
516 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-difftotextpst',
518 ],
519 'contentformat' => [
521 ApiBase::PARAM_HELP_MSG => 'apihelp-query+revisions+base-param-contentformat',
522 ],
523 ];
524 }
525
526}
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a and you may at your option offer warranty protection in exchange for a fee You may modify your copy or copies of the Program or any portion of thus forming a work based on the and copy and distribute such modifications or work under the terms of Section provided that you also meet all of these that in whole or in part contains or is derived from the Program or any part to be licensed as a whole at no charge to all third parties under the terms of this License c If the modified program normally reads commands interactively when run
Definition COPYING.txt:104
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
getContext()
$wgParser
Definition Setup.php:832
getModulePrefix()
Get parameter prefix (usually two letters or an empty string).
Definition ApiBase.php:520
const PARAM_MAX2
(integer) Max value allowed for the parameter for users with the apihighlimits right,...
Definition ApiBase.php:100
const PARAM_DEPRECATED
(boolean) Is the parameter deprecated (will show a warning)?
Definition ApiBase.php:109
const PARAM_MAX
(integer) Max value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition ApiBase.php:94
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
Definition ApiBase.php:1855
getMain()
Get the main module.
Definition ApiBase.php:528
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
Definition ApiBase.php:91
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition ApiBase.php:52
const PARAM_HELP_MSG_PER_VALUE
((string|array|Message)[]) When PARAM_TYPE is an array, this is an array mapping those values to $msg...
Definition ApiBase.php:160
addDeprecation( $msg, $feature, $data=[])
Add a deprecation warning for this module.
Definition ApiBase.php:1793
const PARAM_MIN
(integer) Lowest value allowed for the parameter, for PARAM_TYPE 'integer' and 'limit'.
Definition ApiBase.php:103
const LIMIT_BIG1
Fast query, standard limit.
Definition ApiBase.php:225
const LIMIT_SML2
Slow query, apihighlimits limit.
Definition ApiBase.php:231
validateLimit( $paramName, &$value, $min, $max, $botMax=null, $enforceLimits=false)
Validate the value against the minimum and user/bot maximum limits.
Definition ApiBase.php:1466
getResult()
Get the result object.
Definition ApiBase.php:632
const LIMIT_SML1
Slow query, standard limit.
Definition ApiBase.php:229
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
Definition ApiBase.php:128
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
Definition ApiBase.php:1779
const LIMIT_BIG2
Fast query, apihighlimits limit.
Definition ApiBase.php:227
getModuleName()
Get the name of the module being executed by this instance.
Definition ApiBase.php:512
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
Definition ApiBase.php:55
This class contains a list of pages that the client has requested.
getParent()
@inheritDoc
userCanSeeRevDel()
Check whether the current user has permission to view revision-deleted fields.
encodeParamName( $paramName)
Overrides ApiBase to prepend 'g' to every generator parameter.
A base class for functions common to producing a list of revisions.
executeGenerator( $resultPageSet)
Execute this module as a generator.
getCacheMode( $params)
Get the cache mode for the data generated by this module.
parseParameters( $params)
Parse the parameters into the various instance fields.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
extractRevisionInfo(Revision $revision, $row)
Extract information from the Revision.
run(ApiPageSet $resultPageSet=null)
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
static setContentValue(array &$arr, $name, $value, $flags=0)
Add an output value to the array by name and mark as META_CONTENT.
static getAllContentFormats()
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
static getForModelID( $modelId)
Returns the ContentHandler singleton for the given model ID.
msg( $key)
Get a Message object with context set Parameters are the same as wfMessage()
getUser()
Get the User object.
getConfig()
Get the Config object.
An IContextSource implementation which will inherit context from another source but allow individual ...
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Definition Linker.php:1099
getUserText( $audience=self::FOR_PUBLIC, User $user=null)
Fetch revision's username if it's available to the specified audience.
Definition Revision.php:911
getTitle()
Returns the title of the page associated with this entry or null.
Definition Revision.php:817
getSize()
Returns the length of the text in this revision, or null if unknown.
Definition Revision.php:797
getId()
Get revision ID.
Definition Revision.php:743
getContentHandler()
Returns the content handler appropriate for this revision's content model.
getComment( $audience=self::FOR_PUBLIC, User $user=null)
Fetch revision comment if it's available to the specified audience.
Definition Revision.php:955
getContentModel()
Returns the content model for this revision.
getUser( $audience=self::FOR_PUBLIC, User $user=null)
Fetch revision's user id if it's available to the specified audience.
Definition Revision.php:877
getContent( $audience=self::FOR_PUBLIC, User $user=null)
Fetch revision content if it's available to the specified audience.
const DELETED_USER
Definition Revision.php:92
const DELETED_TEXT
Definition Revision.php:90
getSha1()
Returns the base36 sha1 of the text in this revision, or null if unknown.
Definition Revision.php:806
const DELETED_RESTRICTED
Definition Revision.php:93
userCan( $field, User $user=null)
Determine if the current user is allowed to view a particular field of this revision,...
getParentId()
Get parent revision ID (the original previous page revision)
Definition Revision.php:788
const RAW
Definition Revision.php:100
isDeleted( $field)
const DELETED_COMMENT
Definition Revision.php:91
const FOR_THIS_USER
Definition Revision.php:99
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
Definition Revision.php:116
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
Definition hooks.txt:2780
the value to return A Title object or null for latest all implement SearchIndexField $engine
Definition hooks.txt:2850
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
Definition hooks.txt:901
const CONTENT_MODEL_WIKITEXT
Definition Defines.php:236
$params