IAlex has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/61371


Change subject: Factorise call to getSuggestedDurations() in 
SpecialBlock::getFormFields()
......................................................................

Factorise call to getSuggestedDurations() in SpecialBlock::getFormFields()

So that it is not needed to parse the message two times per request.

Change-Id: I07f48dc35f4904d043844c2a3370bc27cdd5fb45
---
M includes/specials/SpecialBlock.php
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/71/61371/1

diff --git a/includes/specials/SpecialBlock.php 
b/includes/specials/SpecialBlock.php
index 645de23..5a2ad62 100644
--- a/includes/specials/SpecialBlock.php
+++ b/includes/specials/SpecialBlock.php
@@ -127,6 +127,8 @@
 
                $user = $this->getUser();
 
+               $suggestedDurations = self::getSuggestedDurations();
+
                $a = array(
                        'Target' => array(
                                'type' => 'text',
@@ -139,11 +141,11 @@
                                '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(),
                        ),

-- 
To view, visit https://gerrit.wikimedia.org/r/61371
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I07f48dc35f4904d043844c2a3370bc27cdd5fb45
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: IAlex <coderev...@emsenhuber.ch>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to