r44234 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44233‎ | r44234 | r44235 >
Date:15:59, 4 December 2008
Author:catrope
Status:ok (Comments)
Tags:
Comment:
API: (bug 16541) Adding block expiry timestamp to list=logevents output (calculated from the block's timestamp and its duration)
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -140,7 +140,7 @@
141141 $this->getResult()->addValue('query', $this->getModuleName(), $data);
142142 }
143143
144 - public static function addLogParams($result, &$vals, $params, $type) {
 144+ public static function addLogParams($result, &$vals, $params, $type, $ts) {
145145 $params = explode("\n", $params);
146146 switch ($type) {
147147 case 'move':
@@ -169,6 +169,8 @@
170170 case 'block':
171171 $vals2 = array();
172172 list( $vals2['duration'], $vals2['flags'] ) = $params;
 173+ $vals2['expiry'] = wfTimestamp(TS_ISO_8601,
 174+ strtotime($params[0], wfTimestamp(TS_UNIX, $ts)));
173175 $vals[$type] = $vals2;
174176 $params = null;
175177 break;
@@ -200,7 +202,8 @@
201203
202204 if ($this->fld_details && $row->log_params !== '') {
203205 self::addLogParams($this->getResult(), $vals,
204 - $row->log_params, $row->log_type);
 206+ $row->log_params, $row->log_type,
 207+ $row->log_timestamp);
205208 }
206209
207210 if ($this->fld_user) {
Index: trunk/phase3/RELEASE-NOTES
@@ -483,6 +483,7 @@
484484 * (bug 16526) Added usprop=emailable to list=users
485485 * (bug 16548) list=search threw errors with an invalid error code
486486 * (bug 16515) Added pst and onlypst parameters to action=parse
 487+* (bug 16541) Added block expiry timestamp to list=logevents output
487488
488489 === Languages updated in 1.14 ===
489490

Comments

#Comment by Aaron Schulz (talk | contribs)   16:57, 4 December 2008

'infinity' seems to work in eval.php. Looks ok.

Status & tagging log