From: Ori Livneh Date: Mon, 25 Feb 2013 08:15:40 +0000 (-0800) Subject: Flip order of conditionals and add explanatory note X-Git-Tag: 1.31.0-rc.0~20580 X-Git-Url: http://git.cyclocoop.org//%22%22.url_de_base%28%29.%22/%22?a=commitdiff_plain;h=8debd7b5cdd1ad6f6723e40105c38248ed084221;p=lhc%2Fweb%2Fwiklou.git 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 --- 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(