Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
Possible timestamp bug in two smarty files

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
sstrange
Smarty n00b


Joined: 14 Aug 2013
Posts: 2

PostPosted: Wed Aug 14, 2013 6:17 am    Post subject: Possible timestamp bug in two smarty files Reply with quote

In smarty_internal_config.php line 183 (function compileConfigSource) and smarty_internal_template.php line 181 (function compileTemplateSource), $saved_timestamp ='s rather than =='s in the if() statement. $saved_timestamp appears not be defined anywhere. Is this code correct as it generates an error on my website: TEXT: Undefined variable: saved_timestamp?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7281
Location: Lincoln Nebraska, USA

PostPosted: Wed Aug 14, 2013 1:34 pm    Post subject: Reply with quote

It is valid, and it is defined right where it is set:

Code:
if ($saved_timestamp = $this->getCompiledTimestamp()) {


It is not checking for equality, it is checking if the value was false or not. I'm not sure how this would create an undefined variable error? If you do this in PHP:

Code:
if($b = $c) { }


Does $b throw an undefined var error?
Back to top
View user's profile Send private message Visit poster's website
sstrange
Smarty n00b


Joined: 14 Aug 2013
Posts: 2

PostPosted: Wed Aug 14, 2013 9:35 pm    Post subject: Reply with quote

Many thanks for the clarification and I agree with your comments, no error should be generated. I will monitor the situation and see what happens. You should probably close this thread for now.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs 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