MediaWiki REL1_35
|
Public Member Functions | |
setCookieEmulated ( $urlEncode, $name, $value, $options=[]) | |
Temporary emulation for setcookie() or setrawcookie() to match PHP 7.4.3. | |
setCookieInternal ( $urlEncode, $name, $value, $options=[]) | |
Static Public Member Functions | |
static | setcookie ( $name, $value, $options=[]) |
Temporary emulation for setcookie() with a SameSite option and encoding spaces in values as "%20" rather than "+". | |
static | setrawcookie ( $name, $value, $options=[]) |
Temporary emulation for setrawcookie() with a SameSite option. | |
Protected Member Functions | |
error ( $message) | |
header ( $header) | |
headers_sent () | |
time () | |
Definition at line 9 of file SetCookieCompat.php.
|
protected |
Definition at line 223 of file SetCookieCompat.php.
Referenced by Wikimedia\Http\SetCookieCompat\setCookieEmulated().
|
protected |
Definition at line 231 of file SetCookieCompat.php.
References $header, and Wikimedia\Http\SetCookieCompat\header().
Referenced by Wikimedia\Http\SetCookieCompat\header(), and Wikimedia\Http\SetCookieCompat\setCookieEmulated().
|
protected |
Definition at line 227 of file SetCookieCompat.php.
References Wikimedia\Http\SetCookieCompat\headers_sent().
Referenced by Wikimedia\Http\SetCookieCompat\headers_sent(), and Wikimedia\Http\SetCookieCompat\setCookieEmulated().
|
static |
Temporary emulation for setcookie() with a SameSite option and encoding spaces in values as "%20" rather than "+".
Prior to PHP 7.4.3, setcookie() encoded spaces in cookie values as plus signs. PHP 7.4.2 and later no longer decode plus signs as spaces, which is a backward incompatible change that poses a problem when upgrading a live site, especially if not all servers are to be upgraded at once.
Once MediaWiki requires PHP 7.4.3, this can be replaced with a setcookie() call in the caller.
string | $name | The full cookie name |
string | $value | The cookie value |
array | $options | The options as passed to setcookie() in PHP 7.3+ |
Definition at line 29 of file SetCookieCompat.php.
Referenced by Wikimedia\Http\SetCookieCompat\setCookieInternal().
Wikimedia\Http\SetCookieCompat::setCookieEmulated | ( | $urlEncode, | |
$name, | |||
$value, | |||
$options = [] |
|||
) |
Temporary emulation for setcookie() or setrawcookie() to match PHP 7.4.3.
This function corresponds to php_head_parse_cookie_options_array() and php_setcookie() in the PHP source code:
https://github.com/php/php-src/blob/PHP-7.4.3/ext/standard/head.c#L189-L226 https://github.com/php/php-src/blob/PHP-7.4.3/ext/standard/head.c#L79-L187
Definition at line 99 of file SetCookieCompat.php.
References $path, Wikimedia\Http\SetCookieCompat\error(), Wikimedia\Http\SetCookieCompat\header(), Wikimedia\Http\SetCookieCompat\headers_sent(), and Wikimedia\Http\SetCookieCompat\time().
Referenced by Wikimedia\Http\SetCookieCompat\setCookieInternal().
Wikimedia\Http\SetCookieCompat::setCookieInternal | ( | $urlEncode, | |
$name, | |||
$value, | |||
$options = [] |
|||
) |
Definition at line 56 of file SetCookieCompat.php.
References Wikimedia\Http\SetCookieCompat\setcookie(), Wikimedia\Http\SetCookieCompat\setCookieEmulated(), and Wikimedia\Http\SetCookieCompat\setrawcookie().
|
static |
Temporary emulation for setrawcookie() with a SameSite option.
Once MediaWiki requires PHP 7.3, this can be replaced with a setrawcookie() call in the caller.
string | $name | The full cookie name |
string | $value | The cookie value |
array | $options | The options as passed to setrawcookie() in PHP 7.3+ |
Definition at line 44 of file SetCookieCompat.php.
Referenced by Wikimedia\Http\SetCookieCompat\setCookieInternal().
|
protected |
Definition at line 219 of file SetCookieCompat.php.
References Wikimedia\Http\SetCookieCompat\time().
Referenced by Wikimedia\Http\SetCookieCompat\setCookieEmulated(), and Wikimedia\Http\SetCookieCompat\time().