mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-28 04:20:32 +02:00
Fix r9363, DEFINE uses template_compile::compile() which was generating really broken PHP :)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9368 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -228,7 +228,6 @@ class template_compile
|
|||||||
return "\$$echo_var .= '" . str_replace(' ?><?php ', ' ', $template_php) . "'";
|
return "\$$echo_var .= '" . str_replace(' ?><?php ', ' ', $template_php) . "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$template_php = "<?php if (!defined('IN_PHPBB')) exit; ?>" . $template_php;
|
|
||||||
return str_replace(' ?><?php ', ' ', $template_php);
|
return str_replace(' ?><?php ', ' ', $template_php);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -752,6 +751,8 @@ class template_compile
|
|||||||
|
|
||||||
$filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx;
|
$filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx;
|
||||||
|
|
||||||
|
$data = "<?php if (!defined('IN_PHPBB')) exit;" . ((strpos($data, '<?php') === 0) ? substr($data, 5) : ' ?>' . $data);
|
||||||
|
|
||||||
if ($fp = @fopen($filename, 'wb'))
|
if ($fp = @fopen($filename, 'wb'))
|
||||||
{
|
{
|
||||||
@flock($fp, LOCK_EX);
|
@flock($fp, LOCK_EX);
|
||||||
|
Reference in New Issue
Block a user