Skip to content

Commit

Permalink
add headers_sent() check
Browse files Browse the repository at this point in the history
  • Loading branch information
crstauf committed Oct 4, 2023
1 parent c77f539 commit 910da9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cssllc-disable-login.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function init() : void {
return;
}

if ( constant( 'PHP_SESSION_NONE' ) === session_status() ) {
if ( constant( 'PHP_SESSION_NONE' ) === session_status() && ! headers_sent() ) {
session_start();
}

Expand Down Expand Up @@ -90,7 +90,7 @@ public function action__login_init() : void {
* @return void
*/
public function action__wp_login() : void {
if ( constant( 'PHP_SESSION_NONE' ) === session_status() ) {
if ( constant( 'PHP_SESSION_NONE' ) === session_status() && ! headers_sent() ) {
session_start();
}

Expand Down

0 comments on commit 910da9b

Please sign in to comment.