|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
markg85 Smarty n00b
Joined: 28 Dec 2011 Posts: 2
|
Posted: Wed Dec 28, 2011 9:10 pm Post subject: suppressHeader |
|
|
Hi,
In the file smarty_internal_templatecompilerbase.php there is the suppressHeader variable which is false by default and never set to true anywhere in the smarty 3 code.
At line 147 in that same file it adds the following in the header:
Code: | if (!$this->suppressHeader) {
$template_header .= "<?php /* Smarty version " . Smarty::SMARTY_VERSION . ", created on " . strftime("%Y-%m-%d %H:%M:%S") . "\n";
$template_header .= " compiled from \"" . $this->template->source->filepath . "\" */ ?>\n";
} |
Which i think is oke, but not by default! Right now smarty always executes this part (compilation step), but i think the header info can and should be left out. It might add some value for when smarty debugging is enabled?
Just my opinion
Kind regards,
Mark |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Dec 28, 2011 10:10 pm Post subject: |
|
|
Mark, you are wrong. suppressHeader is set in smarty_internal_compile_block.php. |
|
Back to top |
|
markg85 Smarty n00b
Joined: 28 Dec 2011 Posts: 2
|
Posted: Tue Jan 03, 2012 4:32 pm Post subject: |
|
|
U.Tews wrote: | Mark, you are wrong. suppressHeader is set in smarty_internal_compile_block.php. |
Oops.
But that doesn't change the request
Imho that header should only be shown in debug mode. |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Tue Jan 03, 2012 4:43 pm Post subject: |
|
|
You've got it the wrong way. These "headers" are supposed to prevent people from calling template files directly. Sort of a security means for people unable to store that stuff outside of the document root.
You can disable it with $smarty->direct_access_security = false; _________________ Twitter |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Tue Jan 03, 2012 4:46 pm Post subject: |
|
|
This header is as PHP comment in the compiled template files since Smarty2.
Note that debugging is a runtime option which does not chabge compiled files.
I see no reasion to change this. |
|
Back to top |
|
rodneyrehm Administrator
Joined: 30 Mar 2007 Posts: 674 Location: Germany, border to Switzerland
|
Posted: Tue Jan 03, 2012 5:01 pm Post subject: |
|
|
bah… never mind my post! _________________ Twitter |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|