Make WordPress Core

Opened 14 years ago

Closed 11 years ago

#21472 closed enhancement (fixed)

Allow supplying a custom text to status_header()

Reported by: nbachiyski Owned by: johnbillion
Priority: normal Milestone: 4.4
Component: General Version:
Severity: minor Keywords: has-patch commit
Cc: Focuses:

Description

Problem: I'd like to issue a HTTP 500 error, but include a text different from Internal Server Error, so that the client knows what caused the error.

Currently for a known error code the status_header() function always uses the global array $wp_header_to_desc and the only way to have my own text is to set the value in the global array.

The patch adds a second a argument to status_header().

Attachments (3)

status-header-custom-text.diff (699 bytes ) - added by nbachiyski 14 years ago.
21472.diff (764 bytes ) - added by iamfriendly 11 years ago.
Refreshed the patch and added docs
21472.2.diff (941 bytes ) - added by johnbillion 11 years ago.

Download all attachments as: .zip

Change History (8)

#1 @DrewAPicture
12 years ago

  • Keywords needs-refresh needs-docs added

The patch needs a refresh since [25990], and also docs for the new parameter.

@iamfriendly
11 years ago

Refreshed the patch and added docs

#2 @iamfriendly
11 years ago

  • Keywords needs-refresh needs-docs removed

Refreshed the patch and added the docs for the new parameter

#3 @johnbillion
11 years ago

  • Milestone Awaiting Review4.4
  • Owner set to johnbillion
  • Status newreviewing

@johnbillion
11 years ago

#4 @johnbillion
11 years ago

  • Keywords commit added

#5 @johnbillion
11 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 34914:

Add an optional $description parameter to status_header() so custom HTTP status descriptions can be provided.

Fixes #21472
Props nbachiyski, iamfriendly

Note: See TracTickets for help on using tickets.