Merge "Try to make a dent in CodeSniffer reports on includes/ (1)"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 26 Mar 2014 16:14:11 +0000 (16:14 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 26 Mar 2014 16:14:11 +0000 (16:14 +0000)
1  2 
includes/Block.php
includes/DefaultSettings.php

diff --combined includes/Block.php
@@@ -435,7 -435,8 +435,8 @@@ class Block 
         * Update a block in the DB with new parameters.
         * The ID field needs to be loaded first.
         *
-        * @return bool|array False on failure, array on success: ('id' => block ID, 'autoIds' => array of autoblock IDs)
+        * @return bool|array False on failure, array on success:
+        *   ('id' => block ID, 'autoIds' => array of autoblock IDs)
         */
        public function update() {
                wfDebug( "Block::update; timestamp {$this->mTimestamp}\n" );
  
                $affected = $dbw->affectedRows();
  
 -              $dbw->update(
 -                      'ipblocks',
 -                      $this->getAutoblockUpdateArray(),
 -                      array( 'ipb_parent_block_id' => $this->getId() ),
 -                      __METHOD__
 -              );
 +              if ( $this->isAutoblocking() ) {
 +                      // update corresponding autoblock(s) (bug 48813)
 +                      $dbw->update(
 +                              'ipblocks',
 +                              $this->getAutoblockUpdateArray(),
 +                              array( 'ipb_parent_block_id' => $this->getId() ),
 +                              __METHOD__
 +                      );
 +              } else {
 +                      // autoblock no longer required, delete corresponding autoblock(s)
 +                      $dbw->delete(
 +                              'ipblocks',
 +                              array( 'ipb_parent_block_id' => $this->getId() ),
 +                              __METHOD__
 +                      );
 +              }
  
                $dbw->endAtomic( __METHOD__ );
  
                wfDebug( "Autoblocking {$this->getTarget()}@" . $autoblockIP . "\n" );
                $autoblock->setTarget( $autoblockIP );
                $autoblock->setBlocker( $this->getBlocker() );
-               $autoblock->mReason = wfMessage( 'autoblocker', $this->getTarget(), $this->mReason )->inContentLanguage()->plain();
+               $autoblock->mReason = wfMessage( 'autoblocker', $this->getTarget(), $this->mReason )
+                       ->inContentLanguage()->plain();
                $timestamp = wfTimestampNow();
                $autoblock->mTimestamp = $timestamp;
                $autoblock->mAuto = 1;
                        # passed by some callers (bug 29116)
                        return null;
  
-               } elseif ( in_array( $type, array( Block::TYPE_USER, Block::TYPE_IP, Block::TYPE_RANGE, null ) ) ) {
+               } elseif ( in_array(
+                       $type,
+                       array( Block::TYPE_USER, Block::TYPE_IP, Block::TYPE_RANGE, null ) )
+               ) {
                        $block = new Block();
                        $block->fromMaster( $fromMaster );
  
@@@ -4870,6 -4870,17 +4870,6 @@@ $wgCookiePrefix = false
   */
  $wgCookieHttpOnly = true;
  
 -/**
 - * If the requesting browser matches a regex in this blacklist, we won't
 - * send it cookies with HttpOnly mode, even if $wgCookieHttpOnly is on.
 - */
 -$wgHttpOnlyBlacklist = array(
 -      // Internet Explorer for Mac; sometimes the cookies work, sometimes
 -      // they don't. It's difficult to predict, as combinations of path
 -      // and expiration options affect its parsing.
 -      '/^Mozilla\/4\.0 \(compatible; MSIE \d+\.\d+; Mac_PowerPC\)/',
 -);
 -
  /**
   * A list of cookies that vary the cache (for use by extensions)
   */
@@@ -5520,9 -5531,10 +5520,10 @@@ $wgGitBin = '/usr/bin/git'
   * @since 1.20
   */
  $wgGitRepositoryViewers = array(
-       'https://(?:[a-z0-9_]+@)?gerrit.wikimedia.org/r/(?:p/)?(.*)' => 'https://git.wikimedia.org/commit/%r/%H',
-       'ssh://(?:[a-z0-9_]+@)?gerrit.wikimedia.org:29418/(.*)'
-               => 'https://git.wikimedia.org/commit/%r/%H',
+       'https://(?:[a-z0-9_]+@)?gerrit.wikimedia.org/r/(?:p/)?(.*)' =>
+               'https://git.wikimedia.org/commit/%r/%H',
+       'ssh://(?:[a-z0-9_]+@)?gerrit.wikimedia.org:29418/(.*)' =>
+               'https://git.wikimedia.org/commit/%r/%H',
  );
  
  /** @} */ # End of maintenance }
@@@ -6070,44 -6082,30 +6071,44 @@@ $wgAutoloadClasses = array()
  $wgAutoloadAttemptLowercase = true;
  
  /**
 - * An array of extension types and inside that their names, versions, authors,
 - * urls, descriptions and pointers to localized description msgs. Note that
 - * the version, url, description and descriptionmsg key can be omitted.
 + * An array of information about installed extensions keyed by their type.
 + *
 + * All but 'name', 'path' and 'author' can be omitted.
   *
   * @code
   * $wgExtensionCredits[$type][] = array(
 - *     'name' => 'Example extension',
 - *     'version' => 1.9,
   *     'path' => __FILE__,
 - *     'author' => 'Foo Barstein',
 - *     'url' => 'http://www.example.com/Example%20Extension/',
 - *     'description' => 'An example extension',
 + *     'name' => 'Example extension',
 + *     'author' => array(
 + *         'Foo Barstein',
 + *     ),
 + *     'version' => '1.9.0',
 + *     'url' => 'http://example.org/example-extension/',
   *     'descriptionmsg' => 'exampleextension-desc',
 + *     'license-name' => 'GPL-2.0',
   * );
   * @endcode
   *
 - * Where $type is 'specialpage', 'parserhook', 'variable', 'media' or 'other'.
 - * Where 'descriptionmsg' can be an array with message key and parameters:
 - * 'descriptionmsg' => array( 'exampleextension-desc', param1, param2, ... ),
 + * The extensions are listed on Special:Version. This page also looks for a file
 + * named COPYING or LICENSE (optional .txt extension) and provides a link to
 + * view said file. When the 'license-name' key is specified, this file is
 + * interpreted as wikitext.
 + *
 + * - $type: One of 'specialpage', 'parserhook', 'variable', 'media' or 'other'.
 + *
 + * - author: A string or an array of strings. Authors can be linked using
 + *    the regular wikitext link syntax. To have an internationalized version of
 + *    "and others" show, add an element "...". This element can also be linked,
 + *    for instance "[http://example ...]".
 + *
 + * - descriptionmsg: A message key or an an array with message key and parameters:
 + *    `'descriptionmsg' => array( 'exampleextension-desc', param1, param2, ... ),`
 + *
 + * - description: Description of extension as inline string instead of
 + *    localizable message (omit in favour of 'descriptionmsg').
   *
 - * author can be a string or an array of strings. Authors can be linked using
 - * the regular wikitext link syntax. To have an internationalized version of
 - * "and others" show, add an element "...". This element can also be linked,
 - * for instance "[http://example ...]".
 + * - license-name: Short name of the license (used as label for the link), such
 + *   as "GPL-2.0" or "MIT" (https://spdx.org/licenses/ for a list of identifiers).
   */
  $wgExtensionCredits = array();