Skip to content

Commit 059e640

Browse files
World Wide Web ServerWorld Wide Web Server
authored andcommitted
Committed fix to issue #3450 (http://compo.sr/tracker/view.php?id=3450). [Comcode page titles may leak into other Comcode pages when main_comcode_page_children used]
1 parent f723e60 commit 059e640

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

sources/blocks/main_comcode_page_children.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ public function run($map)
101101
);
102102

103103
// Execute child page and get its title
104+
push_output_state();
104105
request_page($child['the_page'], false, $child['the_zone'], null, true);
106+
restore_output_state();
105107
$_title = $GLOBALS['SITE_DB']->query_select_value_if_there('cached_comcode_pages', 'cc_page_title', array('the_page' => $child['the_page'], 'the_zone' => $child['the_zone']));
106108
if (!is_null($_title)) {
107109
$title = get_translated_text($_title);

sources/comcode_renderer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,9 +1084,9 @@ function _do_tags_comcode($tag, $attributes, $embed, $comcode_dangerous, $pass_i
10841084
break;
10851085
}
10861086

1087-
$temp_comcode_parse_title = $COMCODE_PARSE_TITLE;
1087+
push_output_state();
10881088
$temp = request_page($codename, false, $zone, null, true);
1089-
$COMCODE_PARSE_TITLE = $temp_comcode_parse_title;
1089+
restore_output_state();
10901090
if ($temp->is_empty()) {
10911091
$temp_tpl = do_template('WARNING_BOX', array(
10921092
'_GUID' => '1d617fd24b632640dddeeadd8432d7a9',

sources/global3.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ function init__global3()
117117
'CSS_OUTPUT_STARTED',
118118
'CYCLES',
119119
'TEMPCODE_SETGET',
120+
'COMCODE_PARSE_TITLE',
120121
);
121122
_load_blank_output_state();
122123

@@ -418,7 +419,7 @@ function push_output_state($just_tempcode = false, $true_blank = false)
418419
global $OUTPUT_STATE_STACK, $OUTPUT_STATE_VARS;
419420
$current_state = array();
420421
foreach ($OUTPUT_STATE_VARS as $var) {
421-
$current_state[$var] = $GLOBALS[$var];
422+
$current_state[$var] = isset($GLOBALS[$var]) ? $GLOBALS[$var] : null;
422423
}
423424
array_push($OUTPUT_STATE_STACK, $current_state);
424425
_load_blank_output_state($just_tempcode, $true_blank);

sources/zones2.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ function render_comcode_page_box($row, $give_context = true, $include_breadcrumb
138138
$summary = $_summary[1];
139139

140140
if (get_option('is_on_comcode_page_cache') == '1') { // Try and force a parse of the page
141+
push_output_state();
141142
request_page($row['the_page'], false, $row['the_zone'], null, true);
143+
restore_output_state();
142144
}
143145

144146
$row2 = $GLOBALS['SITE_DB']->query_select('cached_comcode_pages', array('*'), array('the_zone' => $row['the_zone'], 'the_page' => $row['the_page']), '', 1);

0 commit comments

Comments
 (0)