mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
Cherry-picked from da76d927ed
Co-Authored-By: Thomas BACCELLI <tbaccelli@gmail.com>
This commit is contained in:
@@ -196,8 +196,8 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource
|
|||||||
*/
|
*/
|
||||||
public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
|
public function hasLock(Smarty $smarty, Smarty_Template_Cached $cached)
|
||||||
{
|
{
|
||||||
clearstatcache(true, $cached->lock_id);
|
clearstatcache(true, $cached->lock_id ?? '');
|
||||||
if (is_file($cached->lock_id)) {
|
if (null !== $cached->lock_id && is_file($cached->lock_id)) {
|
||||||
$t = filemtime($cached->lock_id);
|
$t = filemtime($cached->lock_id);
|
||||||
return $t && (time() - $t < $smarty->locking_timeout);
|
return $t && (time() - $t < $smarty->locking_timeout);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user