Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Bug in isCached function

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


Joined: 14 Dec 2015
Posts: 4

PostPosted: Fri Mar 04, 2016 2:49 pm    Post subject: Bug in isCached function Reply with quote

The git commit 825aa26079319988c1c52bea095e3b8251598c63 from March, 1st by user "uwetews" seems to have introduced a bug into the isCached() function, which breaks my unit tests...

Here is a short example to reproduce the bug (I use PHP 7.0.3 (CLI) under Linux):
Code:

<?php
require 'smarty/libs/Smarty.class.php';

$smarty = new \Smarty();
$smarty->setTemplateDir('.');
$smarty->setCompileDir('/tmp');
$smarty->setCacheDir('/tmp');
$smarty->setCaching(1);
$smarty->fetch('test.tpl');
var_dump($smarty->isCached('test.tpl'));
var_dump($smarty->isCached('test.tpl'));


The first var_dump correctly prints out "bool(true)", the second one throws a PHP warning:
Code:

PHP Warning:  Attempt to assign property of non-object in /var/www/smarty/libs/Smarty.class.php on line 1054
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Fri Mar 04, 2016 4:56 pm    Post subject: Reply with quote

Thanks for bringing this up.
The fix is in the master branch
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