Fix log message for blocks without duration
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 13 Mar 2015 14:16:32 +0000 (15:16 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Mon, 16 Mar 2015 19:51:05 +0000 (20:51 +0100)
Very old blocks form 2004 have not any log_params and therefor enforce a
duration of infinite to be shown on Special:Log.

Follow-Up: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
Change-Id: I4bdfab1ff865501a780ed0c7c50e2b1bab467a4b

includes/logging/BlockLogFormatter.php

index 995b809..436fed8 100644 (file)
@@ -48,6 +48,10 @@ class BlockLogFormatter extends LogFormatter {
 
                $subtype = $this->entry->getSubtype();
                if ( $subtype === 'block' || $subtype === 'reblock' ) {
+                       if ( !isset( $params[4] ) ) {
+                               // Very old log entry without duration: means infinite
+                               $params[4] = 'infinite';
+                       }
                        // Localize the duration, and add a tooltip
                        // in English to help visitors from other wikis.
                        // The lrm is needed to make sure that the number