From: umherirrender Date: Fri, 13 Mar 2015 14:16:32 +0000 (+0100) Subject: Fix log message for blocks without duration X-Git-Tag: 1.31.0-rc.0~12077^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=52bf90f41cdc790bdb83c7a5620f1e582ed5a6a9;p=lhc%2Fweb%2Fwiklou.git Fix log message for blocks without duration 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 --- diff --git a/includes/logging/BlockLogFormatter.php b/includes/logging/BlockLogFormatter.php index 995b8091e5..436fed84bb 100644 --- a/includes/logging/BlockLogFormatter.php +++ b/includes/logging/BlockLogFormatter.php @@ -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