(bug 22868) don't list infinite block expiry date as "now" in API logevents
authorMatthew Britton <gurch@users.mediawiki.org>
Wed, 31 Mar 2010 14:44:35 +0000 (14:44 +0000)
committerMatthew Britton <gurch@users.mediawiki.org>
Wed, 31 Mar 2010 14:44:35 +0000 (14:44 +0000)
RELEASE-NOTES
includes/api/ApiQueryLogEvents.php

index 73b473c..3efc3ab 100644 (file)
@@ -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 ===
 
index da388dc..5c13172 100644 (file)
@@ -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;