mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
Fix for Paul's Polling problem..
git-svn-id: file:///svn/phpbb/trunk@957 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -125,7 +125,6 @@ class Template {
|
||||
|
||||
// Run the compiled code.
|
||||
eval($this->compiled_code[$handle]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -145,13 +144,10 @@ class Template {
|
||||
}
|
||||
|
||||
// Compile it, with the "no echo statements" option on.
|
||||
$code = $this->compile($this->uncompiled_code[$handle], true);
|
||||
// turn it into a variable assignment.
|
||||
$code = '$_str = \'' . $code . '\';';
|
||||
$code = $this->compile($this->uncompiled_code[$handle], true, '_str');
|
||||
|
||||
// evaluate the variable assignment.
|
||||
eval($code);
|
||||
|
||||
// assign the value of the generated variable to the given varname.
|
||||
$this->assign_var($varname, $_str);
|
||||
|
||||
@@ -285,7 +281,7 @@ class Template {
|
||||
* executable, but can be used as part of a variable assignment
|
||||
* for use in assign_code_from_handle().
|
||||
*/
|
||||
function compile($code, $do_not_echo = false)
|
||||
function compile($code, $do_not_echo = false, $retvar = '')
|
||||
{
|
||||
// replace \ with \\ and then ' with \'.
|
||||
$code = str_replace('\\', '\\\\', $code);
|
||||
@@ -406,6 +402,10 @@ class Template {
|
||||
{
|
||||
$code_lines[$i] = 'echo \'' . $code_lines[$i] . '\' . "\\n";';
|
||||
}
|
||||
else
|
||||
{
|
||||
$code_lines[$i] = '$' . $retvar . '.= \'' . $code_lines[$i] . '\' . "\\n";';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,4 +472,4 @@ class Template {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Reference in New Issue
Block a user