From fb18f9d8e7e0f90ddf80e4dfce056271a3c52d7b Mon Sep 17 00:00:00 2001 From: Matthew Britton Date: Wed, 31 Mar 2010 14:44:35 +0000 Subject: [PATCH] (bug 22868) don't list infinite block expiry date as "now" in API logevents --- RELEASE-NOTES | 1 + includes/api/ApiQueryLogEvents.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 73b473cbdd..3efc3ab513 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -75,6 +75,7 @@ logged in (anonpreviewwarning). * (bug 22764) uselang parameter for action=parse * (bug 22944) API: watchlist options are inconsistent * (bug 22339) "Go" result should be available through the API +* (bug 22868) don't list infinite block expiry date as "now" in API logevents === Languages updated in 1.17 === diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index da388dcaa9..5c13172fe8 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -208,8 +208,12 @@ class ApiQueryLogEvents extends ApiQueryBase { case 'block': $vals2 = array(); list( $vals2['duration'], $vals2['flags'] ) = $params; - $vals2['expiry'] = wfTimestamp( TS_ISO_8601, + + // Indefinite blocks have no expiry time + if ( Block::parseExpiryInput( $params[0] ) !== Block::infinity() ) { + $vals2['expiry'] = wfTimestamp( TS_ISO_8601, strtotime( $params[0], wfTimestamp( TS_UNIX, $ts ) ) ); + } $vals[$type] = $vals2; $params = null; break; -- 2.20.1