Skip to content

Commit 6d39d68

Browse files
committed
Work around core logic that silently discarded a status code without description
1 parent 4c122d8 commit 6d39d68

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

maintenance-mode.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ function current_user_can_bypass_vip_maintenance_mode() {
5353
return current_user_can( $required_capability );
5454
}
5555

56-
5756
add_action( 'send_headers', 'vip_maintenance_mode_send_headers', PHP_INT_MAX );
5857

5958
function vip_maintenance_mode_send_headers() {
@@ -73,7 +72,7 @@ function vip_maintenance_mode_send_headers() {
7372
$respond_origin_status_code = apply_filters( 'vip_maintenance_mode_origin_status_code', 503 );
7473

7574
if ( true === $respond_with_status_code ) {
76-
status_header( $respond_origin_status_code );
75+
status_header( $respond_origin_status_code, 'Service Unavailable' );
7776
/**
7877
* Filters the Retry-After value used to indicate how long the service is expected to be unavailable.
7978
*
@@ -104,7 +103,6 @@ function vip_maintenance_mode_template_redirect() {
104103
if ( current_user_can_bypass_vip_maintenance_mode() ) {
105104
return;
106105
}
107-
108106
if ( locate_template( 'template-maintenance-mode.php' ) ) {
109107
get_template_part( 'template-maintenance-mode' );
110108
} else {

0 commit comments

Comments
 (0)