From a94ed97992ef41c5fe513777aa0d04f57060cbf5 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 19 Dec 2008 20:36:18 +0000 Subject: Missing read permission from calls to phpbb_chmod() git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9208 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/includes/functions_template.php') diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 15efc7ec00..9f137d9151 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -755,7 +755,7 @@ class template_compile @flock($fp, LOCK_UN); @fclose($fp); - phpbb_chmod($filename, CHMOD_WRITE); + phpbb_chmod($filename, CHMOD_READ | CHMOD_WRITE); } return; -- cgit v1.2.1 From d9468c35da7df11ff12b0575b69ff97719cc3480 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 11 Mar 2009 12:53:54 +0000 Subject: add IN_PHPBB check to generated cache files git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9363 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_template.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/functions_template.php') diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 9f137d9151..925630e7ec 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -223,9 +223,13 @@ class template_compile // There will be a number of occasions where we switch into and out of // PHP mode instantaneously. Rather than "burden" the parser with this // we'll strip out such occurences, minimising such switching - $template_php = str_replace(' ?>" . $template_php; + return str_replace(' ?> Date: Sat, 14 Mar 2009 02:08:04 +0000 Subject: 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 --- phpBB/includes/functions_template.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/includes/functions_template.php') diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 925630e7ec..46c7cedc01 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -228,7 +228,6 @@ class template_compile return "\$$echo_var .= '" . str_replace(' ?>" . $template_php; return str_replace(' ?>template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx; + $data = "' . $data); + if ($fp = @fopen($filename, 'wb')) { @flock($fp, LOCK_EX); -- cgit v1.2.1 From 193396e9d0488805d96721cce642d7b6f33f7810 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Tue, 31 Mar 2009 12:21:36 +0000 Subject: Enforce correct case for template variables. {var} no longer works for example. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9419 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_template.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/includes/functions_template.php') diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 46c7cedc01..42a5eb3248 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -256,19 +256,19 @@ class template_compile // transform vars prefixed by L_ into their language variable pendant if nothing is set within the tpldata array if (strpos($text_blocks, '{L_') !== false) { - $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ \\1 }')); ?>", $text_blocks); + $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]+)\}#', "_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ \\1 }')); ?>", $text_blocks); } // Handle addslashed language variables prefixed with LA_ // If a template variable already exist, it will be used in favor of it... if (strpos($text_blocks, '{LA_') !== false) { - $text_blocks = preg_replace('#\{LA_([a-z0-9\-_]*)\}#is', "_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks); + $text_blocks = preg_replace('#\{LA_([A-Z0-9\-_]+)\}#', "_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks); } // Handle remaining varrefs - $text_blocks = preg_replace('#\{([a-z0-9\-_]+)\}#is', "_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks); - $text_blocks = preg_replace('#\{\$([a-z0-9\-_]+)\}#is', "_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks); + $text_blocks = preg_replace('#\{([A-Z0-9\-_]+)\}#', "_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks); + $text_blocks = preg_replace('#\{\$([A-Z0-9\-_]+)\}#', "_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks); return; } -- cgit v1.2.1