From 215894fda9755f0d7fd053d4239e0f73f6ff9559 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 29 Apr 2013 15:48:57 +0200 Subject: [PATCH] Factorise call to getSuggestedDurations() in SpecialBlock::getFormFields() So that it is not needed to parse the message two times per request. Change-Id: I07f48dc35f4904d043844c2a3370bc27cdd5fb45 --- includes/specials/SpecialBlock.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 645de2363c..5a2ad62944 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -127,6 +127,8 @@ class SpecialBlock extends FormSpecialPage { $user = $this->getUser(); + $suggestedDurations = self::getSuggestedDurations(); + $a = array( 'Target' => array( 'type' => 'text', @@ -139,11 +141,11 @@ class SpecialBlock extends FormSpecialPage { 'validation-callback' => array( __CLASS__, 'validateTargetField' ), ), 'Expiry' => array( - 'type' => !count( self::getSuggestedDurations() ) ? 'text' : 'selectorother', + 'type' => !count( $suggestedDurations ) ? 'text' : 'selectorother', 'label-message' => 'ipbexpiry', 'required' => true, 'tabindex' => '2', - 'options' => self::getSuggestedDurations(), + 'options' => $suggestedDurations, 'other' => $this->msg( 'ipbother' )->text(), 'default' => $this->msg( 'ipb-default-expiry' )->inContentLanguage()->text(), ), -- 2.20.1