mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
- bugfix custom cache resource did not observe compile_id and cache_id when $cache_locking == true
This commit is contained in:
@@ -272,12 +272,11 @@ abstract class Smarty_CacheResource_Custom extends Smarty_CacheResource
|
|||||||
$id = $cached->lock_id;
|
$id = $cached->lock_id;
|
||||||
$name = $cached->source->name . '.lock';
|
$name = $cached->source->name . '.lock';
|
||||||
|
|
||||||
$mtime = $this->fetchTimestamp($id, $name, null, null);
|
$mtime = $this->fetchTimestamp($id, $name, $cached->cache_id, $cached->compile_id);
|
||||||
if ($mtime === null) {
|
if ($mtime === null) {
|
||||||
$this->fetch($id, $name, null, null, $content, $mtime);
|
$this->fetch($id, $name, $cached->cache_id, $cached->compile_id, $content, $mtime);
|
||||||
}
|
}
|
||||||
$stat = $mtime && ($t = time()) - $mtime < $smarty->locking_timeout;
|
return $mtime && ($t = time()) - $mtime < $smarty->locking_timeout;
|
||||||
return $stat ? $mtime : $stat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user