Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 317d53e

Browse files
author
Michael Sisk
committed
Prevent setcookie() if headers were already sent.
1 parent d2d47e3 commit 317d53e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

-/php/tags.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ public static function verify_webcomic_age( $collection = '', $user = false, $ag
455455
) {
456456
if ( $save and !empty( $user->ID ) ) {
457457
update_user_meta( $user->ID, 'webcomic_birthday', $birthday );
458-
} elseif ( $save ) {
458+
} elseif ( $save and !headers_sent() ) {
459459
setcookie( 'webcomic_birthday_' . COOKIEHASH, $birthday, ( integer ) current_time( 'timestamp' ) + 604800, COOKIEPATH );
460460
}
461461

0 commit comments

Comments
 (0)