From 8debd7b5cdd1ad6f6723e40105c38248ed084221 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Mon, 25 Feb 2013 00:15:40 -0800 Subject: [PATCH] Flip order of conditionals and add explanatory note The conditional is nominally more performant and considerably more readable with its constituents flipped. Also adds an explanatory note. Prompted by confusion over change Ie89507f8e98c365df9d93a7633223103b9025790. Change-Id: I2d3db63bdbcebe0fd59c063c9f371362c9d07f91 --- includes/WebResponse.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/WebResponse.php b/includes/WebResponse.php index 3862354aca..4276fb0183 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -70,7 +70,11 @@ class WebResponse { $secureCookie = $forceSecure; } - $httpOnlySafe = wfHttpOnlySafe() && $wgCookieHttpOnly; + // Mark the cookie as httpOnly if $wgCookieHttpOnly is true, + // unless the requesting user-agent is known to have trouble with + // httpOnly cookies. + $httpOnlySafe = $wgCookieHttpOnly && wfHttpOnlySafe(); + wfDebugLog( 'cookie', 'setcookie: "' . implode( '", "', array( -- 2.20.1