* (bug 16516) Made rvsection=T-2 work
* (bug 16526) Added usprop=emailable to list=users
* (bug 16548) list=search threw errors with an invalid error code
+* (bug 16515) Added pst and onlypst parameters to action=parse
=== Languages updated in 1.14 ===
$titleObj = Title::newFromText($title);
if(!$titleObj)
$titleObj = Title::newFromText("API");
+ if($params['pst'] || $params['onlypst'])
+ $text = $wgParser->preSaveTransform($text, $titleObj, $wgUser, $popts);
+ if($params['onlypst'])
+ {
+ // Build a result and bail out
+ $result_array['text'] = array();
+ $this->getResult()->setContent($result_array['text'], $text);
+ $this->getResult()->addValue(null, $this->getModuleName(), $result_array);
+ return;
+ }
$p_result = $wgParser->parse($text, $titleObj, $popts);
}
'sections',
'revid'
)
- )
+ ),
+ 'pst' => false,
+ 'onlypst' => false,
);
}
'prop' => array('Which pieces of information to get.',
'NOTE: Section tree is only generated if there are more than 4 sections, or if the __TOC__ keyword is present'
),
+ 'pst' => array( 'Do a pre-save transform on the input before parsing it.',
+ 'Ignored if page or oldid is used.'
+ ),
+ 'onlypst' => array('Do a PST on the input, but don\'t parse it.',
+ 'Returns PSTed wikitext. Ignored if page or oldid is used.'
+ ),
);
}
$this->getResult()->addValue('query', $this->getModuleName(), $data);
}
- public static function addLogParams($result, &$vals, $params, $type) {
+ public static function addLogParams($result, &$vals, $params, $type, $ts) {
$params = explode("\n", $params);
switch ($type) {
case 'move':
case 'block':
$vals2 = array();
list( $vals2['duration'], $vals2['flags'] ) = $params;
+ $vals2['expiry'] = wfTimestamp(TS_ISO_8601,
+ strtotime($params[0], wfTimestamp(TS_UNIX, $ts)));
$vals[$type] = $vals2;
$params = null;
break;
if ($this->fld_details && $row->log_params !== '') {
self::addLogParams($this->getResult(), $vals,
- $row->log_params, $row->log_type);
+ $row->log_params, $row->log_type,
+ $row->log_timestamp);
}
if ($this->fld_user) {
$this->addTables(array (
'watchlist',
- 'page',
'recentchanges'
));
$this->addWhere(array (
'wl_namespace = rc_namespace',
'wl_title = rc_title',
- 'rc_cur_id = page_id',
'wl_user' => $userId,
'rc_deleted' => 0,
));
$this->addWhereRange('rc_timestamp', $dir, $start, $end);
$this->addWhereFld('wl_namespace', $namespace);
- $this->addWhereIf('rc_this_oldid=page_latest', !$allrev);
+ if(!$allrev)
+ {
+ $this->addTables('page');
+ $this->addWhere('page_id=rc_cur_id');
+ $this->addWhereIf('rc_this_oldid=page_latest');
+ }
if (!is_null($show)) {
$show = array_flip($show);