Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pinc/html_page_common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ function output_html_header(?string $nameofpage, array $extra_args = [], bool $s
{
global $code_url;

static $was_output = false;
if ($was_output) {
static $output_caller = null;
if (!is_null($output_caller)) {
$loc = get_backtrace_loc();
error_log("output_html_header: called from $output_caller then $loc");
return;
}
$was_output = true;
$output_caller = get_backtrace_loc();

$user = User::load_current();

Expand Down
8 changes: 5 additions & 3 deletions pinc/slim_header.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ function slim_footer(array $extra_args = []): void
{
// Despite not needing to, some pages may still be calling slim_footer
// so check to see if we've already output the footer.
static $was_output = false;
if ($was_output) {
static $output_caller = null;
if (!is_null($output_caller)) {
$loc = get_backtrace_loc();
error_log("slim_footer: called from $output_caller then $loc");
return;
}

output_html_footer($extra_args);

$was_output = true;
$output_caller = get_backtrace_loc();
}
8 changes: 5 additions & 3 deletions tools/project_manager/generate_post_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ function output_page_header(Project $project): void

// Allow this function to be called multiple times but only output
// the contents once.
static $was_output = false;
if ($was_output) {
static $output_caller = null;
if (!is_null($output_caller)) {
$loc = get_backtrace_loc();
error_log("output_page_header: called from $output_caller then $loc");
return;
}
$was_output = true;
$output_caller = get_backtrace_loc();

$title = _("Generating Post Files");
slim_header($title);
Expand Down