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

NOTICE in smarty_resource.php line 679

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
gizmore
Smarty n00b


Joined: 11 Nov 2011
Posts: 1

PostPosted: Fri Nov 11, 2011 5:46 pm    Post subject: NOTICE in smarty_resource.php line 679 Reply with quote

There seems to be a NOTICE thrown if a template is not compiled yet.
The problem is in smarty_resource.php line 679 (filemtime)

Line 677-680
Code:

        $compiled = new Smarty_Template_Compiled($this);
        $this->handler->populateCompiledFilepath($compiled, $_template);
        $compiled->timestamp = @filemtime($compiled->filepath);
        $compiled->exists = !!$compiled->timestamp;


I am currently using this fix:

Line 677-689
Code:

        $compiled = new Smarty_Template_Compiled($this);
        $this->handler->populateCompiledFilepath($compiled, $_template);
       
        if (is_file($compiled->filepath))
        {
           $compiled->timestamp = filemtime($compiled->filepath);
           $compiled->exists = true;
        }
        else
        {
           $compiled->timestamp = false;
           $compiled->exists = false;
        }


Thank you for smarty and your time.
gizmore


EDIT:

I just read in a similar topic that custom error handlers should check if the error is supressed and the behaviour is intended for speed and security issues (race condition)

Sorry for wasting your time Smile
Back to top
View user's profile Send private message Send e-mail
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 -> 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