| @@ -1,5 +1,5 @@ | ||
| 1 | -<?php | |
| 1 | +<?php // phpcs:ignore WordPress.Files.FileName.NotHyphenatedLowercase | |
| 2 | 2 | /** |
| 3 | 3 | * This file is meant to be the home for any function handling cookies that can |
| 4 | 4 | * be accessed anywhere within Jetpack. |
| 5 | 5 | * |
| @@ -8,12 +8,13 @@ | ||
| 8 | 8 | * @package automattic/jetpack |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | - * A PHP 5.X compatible version of the array argument version of PHP 7.3's setcookie(). | |
| 12 | + * A PHP 7.0 compatible version of the array argument version of PHP 7.3's setcookie(). | |
| 13 | 13 | * |
| 14 | 14 | * Useful for setting SameSite cookies in PHP 7.2 or earlier. |
| 15 | 15 | * |
| 16 | + * @deprecated since 16.2. Use `setcookie()` instead now that we've dropped PHP 7.2 support. | |
| 16 | 17 | * @param string $name Name of the cookie. |
| 17 | 18 | * @param string $value Value of the cookie. |
| 18 | 19 | * @param array $options Options to include with the cookie. |
| 19 | 20 | * @return bool False when error happens, other wise true. |
| @@ -18,8 +19,10 @@ | ||
| 18 | 19 | * @param array $options Options to include with the cookie. |
| 19 | 20 | * @return bool False when error happens, other wise true. |
| 20 | 21 | */ |
| 21 | 22 | function jetpack_shim_setcookie( $name, $value, $options ) { |
| 23 | + _deprecated_function( __FUNCTION__, 'jetpack-16.2', 'setcookie' ); | |
| 24 | + | |
| 22 | 25 | $not_allowed_chars = ",; \t\r\n\013\014"; |
| 23 | 26 | |
| 24 | 27 | if ( false !== strpbrk( $name, $not_allowed_chars ) ) { |
| 25 | 28 | return false; |