From: Reedy Date: Fri, 22 Apr 2016 20:35:21 +0000 (+0100) Subject: Remove old WebResponse::setCookie() calling method X-Git-Tag: 1.31.0-rc.0~6415^2 X-Git-Url: http://git.cyclocoop.org/?a=commitdiff_plain;h=6ad0357839bfd21191085b3b423a98f6b0c6ffca;p=lhc%2Fweb%2Fwiklou.git Remove old WebResponse::setCookie() calling method Change-Id: Ibd548ea5bfe08f7fef35273c5a9c6c70c3faf60e --- diff --git a/includes/WebResponse.php b/includes/WebResponse.php index 458c2079e4..90b76e3327 100644 --- a/includes/WebResponse.php +++ b/includes/WebResponse.php @@ -89,26 +89,12 @@ class WebResponse { * path: string, cookie path ($wgCookiePath) * secure: bool, secure attribute ($wgCookieSecure) * httpOnly: bool, httpOnly attribute ($wgCookieHttpOnly) - * raw: bool, if true uses PHP's setrawcookie() instead of setcookie() - * For backwards compatibility, if $options is not an array then it and - * the following two parameters will be interpreted as values for - * 'prefix', 'domain', and 'secure' * @since 1.22 Replaced $prefix, $domain, and $forceSecure with $options */ public function setCookie( $name, $value, $expire = 0, $options = [] ) { global $wgCookiePath, $wgCookiePrefix, $wgCookieDomain; global $wgCookieSecure, $wgCookieExpiration, $wgCookieHttpOnly; - if ( !is_array( $options ) ) { - // Backwards compatibility - $options = [ 'prefix' => $options ]; - if ( func_num_args() >= 5 ) { - $options['domain'] = func_get_arg( 4 ); - } - if ( func_num_args() >= 6 ) { - $options['secure'] = func_get_arg( 5 ); - } - } $options = array_filter( $options, function ( $a ) { return $a !== null; } ) + [ @@ -268,16 +254,6 @@ class FauxResponse extends WebResponse { global $wgCookiePath, $wgCookiePrefix, $wgCookieDomain; global $wgCookieSecure, $wgCookieExpiration, $wgCookieHttpOnly; - if ( !is_array( $options ) ) { - // Backwards compatibility - $options = [ 'prefix' => $options ]; - if ( func_num_args() >= 5 ) { - $options['domain'] = func_get_arg( 4 ); - } - if ( func_num_args() >= 6 ) { - $options['secure'] = func_get_arg( 5 ); - } - } $options = array_filter( $options, function ( $a ) { return $a !== null; } ) + [