Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

suppressHeader

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development
View previous topic :: View next topic  
Author Message
markg85
Smarty n00b


Joined: 28 Dec 2011
Posts: 2

PostPosted: Wed Dec 28, 2011 9:10 pm    Post subject: suppressHeader Reply with quote

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 Smile

Kind regards,
Mark
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Wed Dec 28, 2011 10:10 pm    Post subject: Reply with quote

Mark, you are wrong. suppressHeader is set in smarty_internal_compile_block.php.
Back to top
View user's profile Send private message
markg85
Smarty n00b


Joined: 28 Dec 2011
Posts: 2

PostPosted: Tue Jan 03, 2012 4:32 pm    Post subject: Reply with quote

U.Tews wrote:
Mark, you are wrong. suppressHeader is set in smarty_internal_compile_block.php.


Oops.

But that doesn't change the request Smile
Imho that header should only be shown in debug mode.
Back to top
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Tue Jan 03, 2012 4:43 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Jan 03, 2012 4:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
rodneyrehm
Administrator


Joined: 30 Mar 2007
Posts: 674
Location: Germany, border to Switzerland

PostPosted: Tue Jan 03, 2012 5:01 pm    Post subject: Reply with quote

bah… never mind my post!
_________________
Twitter
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Smarty Development All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP