Merge "Remove $wgHttpOnlyBlacklist"
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index a6f936f..f0b0a8d 100644 (file)
@@ -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
@@ -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 );
        }
 }
@@ -3443,23 +3441,6 @@ function wfBaseConvert( $input, $sourceBase, $destBase, $pad = 1,
        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
@@ -3532,7 +3513,6 @@ function wfSetupSession( $sessionId = false ) {
                # 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(
@@ -3540,8 +3520,9 @@ function wfSetupSession( $sessionId = false ) {
                                $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 );