Mybb: Return correct HTTP status codes

Created on 4 Oct 2017  Â·  4Comments  Â·  Source: mybb/mybb

The default MyBB forum/thread/user not found/does not exist pages return HTTP status code 200 (success) currently. I think that PHP's http_response_code function should be used and make those pages return the correct HTTP 404 status code.

Could this be extended to make the 'no permissions' error page return a status code of 403 (forbidden) or 401 (unauthorised)?

Original thread: Return correct HTTP status codes

1.9 confirmed enhancement

Most helpful comment

We can also use header to set a status code too, which is backwards compatible. We'd have a my_http_response_code() function to decide which to use.

All 4 comments

http_response_code was introduced in PHP 5.4.0 so the minimum requirements would need to be bumped from PHP >= 5.2.

We can also use header to set a status code too, which is backwards compatible. We'd have a my_http_response_code() function to decide which to use.

Euan, this should be moved to 1.9? @euantorano

Yep

On 9 Jun 2018, at 19:50, Ben notifications@github.com wrote:

Euan, this should be moved to 1.9? @euantorano

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

euantorano picture euantorano  Â·  4Comments

Ben-MyBB picture Ben-MyBB  Â·  5Comments

yuliu picture yuliu  Â·  6Comments

LogicPlague picture LogicPlague  Â·  5Comments

RikoDEV picture RikoDEV  Â·  3Comments