Permalink
Browse files

Prevent setcookie() if headers were already sent.

  • Loading branch information...
1 parent d2d47e3 commit 317d53e9b73729854bcd16c1b89a4d7aee9223e8 Michael Sisk committed Apr 29, 2014
Showing with 1 addition and 1 deletion.
  1. +1 −1 -/php/tags.php
View
@@ -455,7 +455,7 @@ public static function verify_webcomic_age( $collection = '', $user = false, $ag
) {
if ( $save and !empty( $user->ID ) ) {
update_user_meta( $user->ID, 'webcomic_birthday', $birthday );
- } elseif ( $save ) {
+ } elseif ( $save and !headers_sent() ) {
setcookie( 'webcomic_birthday_' . COOKIEHASH, $birthday, ( integer ) current_time( 'timestamp' ) + 604800, COOKIEPATH );
}

0 comments on commit 317d53e

Please sign in to comment.