Merge "Remove $wgHttpOnlyBlacklist"
[lhc/web/wiklou.git] / includes / GlobalFunctions.php
index 0e95ef7..f0b0a8d 100644 (file)
@@ -3441,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
@@ -3530,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(
@@ -3538,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 );