mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00: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:
parent
5c6eb1e149
commit
9ef75ba2b8
1 changed files with 7 additions and 7 deletions
|
@ -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";';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue