Merge pull request #17948 from woocommerce/add/17920-httponly-cookie-filter
Introduce woocommerce_cookie_httponly filter
This commit is contained in:
commit
64ffa22e16
|
@ -773,7 +773,7 @@ function wc_print_js() {
|
||||||
*/
|
*/
|
||||||
function wc_setcookie( $name, $value, $expire = 0, $secure = false ) {
|
function wc_setcookie( $name, $value, $expire = 0, $secure = false ) {
|
||||||
if ( ! headers_sent() ) {
|
if ( ! headers_sent() ) {
|
||||||
setcookie( $name, $value, $expire, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, $secure );
|
setcookie( $name, $value, $expire, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, $secure, apply_filters( 'woocommerce_cookie_httponly', false, $name, $value, $expire, $secure ) );
|
||||||
} elseif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
} elseif ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
||||||
headers_sent( $file, $line );
|
headers_sent( $file, $line );
|
||||||
trigger_error( "{$name} cookie cannot be set - headers already sent by {$file} on line {$line}", E_USER_NOTICE );
|
trigger_error( "{$name} cookie cannot be set - headers already sent by {$file} on line {$line}", E_USER_NOTICE );
|
||||||
|
|
Loading…
Reference in New Issue