Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web: wrong use of error_page() function throughout the code #2960

Closed
ChristianBeer opened this issue Jan 12, 2019 · 0 comments · Fixed by #2979
Closed

Web: wrong use of error_page() function throughout the code #2960

ChristianBeer opened this issue Jan 12, 2019 · 0 comments · Fixed by #2979

Comments

@ChristianBeer
Copy link
Member

Describe the bug
The current implementation of error_page() in html/inc/util.inc#L367 contains a call to page_head() which among other things outputs header information (via header(). This means that after a page called page_head() itself it can't use the current error_page() function or the header is output twice. This leads to duplication of HTML code (two navbars) and PHP warnings Cannot modify header information - headers already sent by.

Steps To Reproduce

  1. Create a page that calls error_page() after page_head()
  2. View this page with a browser

Expected behavior
There should be no warnings and only one vaigation bar on the top. Therefore the second call to page_head() when calling error_page() after page_head() should be avoided. When error_page() is called before page_head() then of course it needs to call page_head() itself.

Scope
This is a rather big change as one has to check each PHP file and modify the error_page() call that happens after a page_head() call. So I would propose to do this in chunks and document progress in this issue.

@ChristianBeer ChristianBeer added this to the Server milestone Jan 12, 2019
Rytiss added a commit that referenced this issue Jan 23, 2019
error_page() calls page_head(), but there are instances of code that call error_page() having already called page_head() before, thus attempting to send headers twice and creating double page header.

Fixes #2960
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants