mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- bugfix template inheritance failed to compile with delimiters {/ and /} (Forum Topic 23008)
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== trunk =====
|
===== trunk =====
|
||||||
|
14.09.2012
|
||||||
|
- bugfix template inheritance failed to compile with delimiters {/ and /} (Forum Topic 23008)
|
||||||
|
|
||||||
11.09.2012
|
11.09.2012
|
||||||
- bugfix escape Smarty exception messages to avoid possible script execution
|
- bugfix escape Smarty exception messages to avoid possible script execution
|
||||||
|
|
||||||
|
@@ -101,17 +101,17 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
|
|||||||
$replacement = '';
|
$replacement = '';
|
||||||
}
|
}
|
||||||
// replace {$smarty.block.child} tag
|
// replace {$smarty.block.child} tag
|
||||||
$search = array("%({$_ldl}{$al}block[\s\S]*?{$name}[\s\S]*?{$_rdl})([\s\S]*?)({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})([\s\S]*?)({$_ldl}{$al}/block\s*{$_rdl})%", "/<2F><><EFBFBD>child<6C><64><EFBFBD>/");
|
$search = array("!({$_ldl}{$al}block[\s\S]*?{$name}[\s\S]*?{$_rdl})([\s\S]*?)({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})([\s\S]*?)({$_ldl}{$al}/block\s*{$_rdl})!", "/<2F><><EFBFBD>child<6C><64><EFBFBD>/");
|
||||||
$replace = array('\2<><32><EFBFBD>child<6C><64><EFBFBD>\4', $replacement);
|
$replace = array('\2<><32><EFBFBD>child<6C><64><EFBFBD>\4', $replacement);
|
||||||
$block_content = preg_replace($search, $replace, $block_content);
|
$block_content = preg_replace($search, $replace, $block_content);
|
||||||
} else {
|
} else {
|
||||||
// remove hidden blocks
|
// remove hidden blocks
|
||||||
$block_content = preg_replace("%({$_ldl}{$al}block[\s\S]*?{$name}[\s\S]*?{$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl})%", '', $block_content);
|
$block_content = preg_replace("!({$_ldl}{$al}block[\s\S]*?{$name}[\s\S]*?{$_rdl}[\s\S]*?{$_ldl}{$al}/block\s*{$_rdl})!", '', $block_content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// do we have not nested {$smart.block.child}
|
// do we have not nested {$smart.block.child}
|
||||||
if (0 != preg_match("/({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})/", $block_content, $_match2)) {
|
if (0 != preg_match("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $block_content, $_match2)) {
|
||||||
// get child replacement for this block
|
// get child replacement for this block
|
||||||
if (isset($template->block_data[$_name])) {
|
if (isset($template->block_data[$_name])) {
|
||||||
$replacement = $template->block_data[$_name]['source'];
|
$replacement = $template->block_data[$_name]['source'];
|
||||||
@@ -119,7 +119,7 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_CompileBase {
|
|||||||
} else {
|
} else {
|
||||||
$replacement = '';
|
$replacement = '';
|
||||||
}
|
}
|
||||||
$block_content = preg_replace("/({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})/", $replacement, $block_content);
|
$block_content = preg_replace("!({$_ldl}{$al}\\\$smarty\.block\.child\s*{$_rdl})!", $replacement, $block_content);
|
||||||
}
|
}
|
||||||
if (isset($template->block_data[$_name])) {
|
if (isset($template->block_data[$_name])) {
|
||||||
if (strpos($template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
|
if (strpos($template->block_data[$_name]['source'], '%%%%SMARTY_PARENT%%%%') !== false) {
|
||||||
|
Reference in New Issue
Block a user