X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiExpandTemplates.php;h=eb3f87cb56eeb4faf4e85f0a6d8f2a5f041a609e;hb=ecc71fc9e4bac94a879c0734d90ba0b94211d5d3;hp=e3be4e0d295d7596003b7fef2bca71a22f4a024f;hpb=c265c30d296a0ab558a2a61d904f478560aa1936;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiExpandTemplates.php b/includes/api/ApiExpandTemplates.php index e3be4e0d29..eb3f87cb56 100644 --- a/includes/api/ApiExpandTemplates.php +++ b/includes/api/ApiExpandTemplates.php @@ -109,10 +109,13 @@ class ApiExpandTemplates extends ApiBase { $retval['categories'] = $categories_result; } } - if ( isset ( $prop['volatile'] ) && $frame->isVolatile() ) { + if ( isset( $prop['volatile'] ) && $frame->isVolatile() ) { $retval['volatile'] = ''; } - if ( isset ( $prop['wikitext'] ) ) { + if ( isset( $prop['ttl'] ) && $frame->getTTL() !== null ) { + $retval['ttl'] = $frame->getTTL(); + } + if ( isset( $prop['wikitext'] ) ) { $retval['wikitext'] = $wikitext; } } @@ -135,6 +138,7 @@ class ApiExpandTemplates extends ApiBase { 'wikitext', 'categories', 'volatile', + 'ttl', 'parsetree', ), ApiBase::PARAM_ISMULTI => true, @@ -156,6 +160,7 @@ class ApiExpandTemplates extends ApiBase { ' wikitext - The expanded wikitext', ' categories - Any categories present in the input that are not represented in the wikitext output', ' volatile - Whether the output is volatile and should not be reused elsewhere within the page', + ' ttl - The maximum time after which caches of the result should be invalidated', ' parsetree - The XML parse tree of the input', 'Note that if no values are selected, the result will contain the wikitext,', 'but the output will be in a deprecated format.', @@ -182,6 +187,12 @@ class ApiExpandTemplates extends ApiBase { ApiBase::PROP_NULLABLE => true, ), ), + 'ttl' => array( + 'ttl' => array( + ApiBase::PROP_TYPE => 'integer', + ApiBase::PROP_NULLABLE => true, + ), + ), 'parsetree' => array( 'parsetree' => 'string', ),