Merge "Remove $wgHttpOnlyBlacklist"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 25 Mar 2014 13:13:34 +0000 (13:13 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 25 Mar 2014 13:13:34 +0000 (13:13 +0000)
1  2 
includes/DefaultSettings.php
includes/GlobalFunctions.php

@@@ -4870,17 -4870,6 +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)
   */
@@@ -6020,7 -6009,7 +6009,7 @@@ $wgExtensionMessagesFiles = array()
   * @since 1.23
   */
  $wgMessagesDirs = array(
 -      "$IP/resources/oojs-ui/i18n",
 +      'oojs-ui' => "$IP/resources/oojs-ui/i18n",
  );
  
  /**
@@@ -6081,44 -6070,30 +6070,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();
  
@@@ -1027,8 -1027,10 +1027,8 @@@ function wfDebugMem( $exact = false ) 
   *
   * @since 1.23 support for sampling log messages via $wgDebugLogGroups.
   *
 - * @param $logGroup String
 - * @param $text String
 - * @param bool $public whether to log the event in the public log if no private
 - *                     log file is specified, (default true)
 + * @param string $logGroup
 + * @param string $text
   * @param string|bool $dest Destination of the message:
   *     - 'all': both to the log and HTML (debug toolbar or HTML comments)
   *     - 'log': only to the log and not in HTML
@@@ -1107,7 -1109,7 +1107,7 @@@ function wfLogDBError( $text ) 
  
                $date = $d->format( 'D M j G:i:s T Y' );
  
 -              $text = "$date\t$host\t$wiki\t$text";
 +              $text = "$date\t$host\t$wiki\t" . trim( $text ) . "\n";
                wfErrorLog( $text, $wgDBerrorLog );
        }
  }
@@@ -3441,23 -3443,6 +3441,6 @@@ function wfBaseConvert( $input, $source
        return str_pad( $result, $pad, '0', STR_PAD_LEFT );
  }
  
- /**
-  * @return bool
-  */
- function wfHttpOnlySafe() {
-       global $wgHttpOnlyBlacklist;
-       if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) {
-               foreach ( $wgHttpOnlyBlacklist as $regex ) {
-                       if ( preg_match( $regex, $_SERVER['HTTP_USER_AGENT'] ) ) {
-                               return false;
-                       }
-               }
-       }
-       return true;
- }
  /**
   * Check if there is sufficient entropy in php's built-in session generation
   * @return bool true = there is sufficient entropy
@@@ -3530,7 -3515,6 +3513,6 @@@ function wfSetupSession( $sessionId = f
                # hasn't already been set to the desired value (that causes errors)
                ini_set( 'session.save_handler', $wgSessionHandler );
        }
-       $httpOnlySafe = wfHttpOnlySafe() && $wgCookieHttpOnly;
        wfDebugLog( 'cookie',
                'session_set_cookie_params: "' . implode( '", "',
                        array(
                                $wgCookiePath,
                                $wgCookieDomain,
                                $wgCookieSecure,
-                               $httpOnlySafe ) ) . '"' );
-       session_set_cookie_params( 0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $httpOnlySafe );
+                               $wgCookieHttpOnly ) ) . '"' );
+       session_set_cookie_params(
+               0, $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookieHttpOnly );
        session_cache_limiter( 'private, must-revalidate' );
        if ( $sessionId ) {
                session_id( $sessionId );