Commit 7595aa78 authored by alexpott's avatar alexpott

Issue #2429659 by chx, Berdir, mpdonadio, geerlingguy, Cottser, rteijeiro,...

Issue #2429659 by chx, Berdir, mpdonadio, geerlingguy, Cottser, rteijeiro, Fabianx, catch, dawehner: Race conditions in the twig template cache
parent 0c810aa1
......@@ -119,12 +119,7 @@ public function loadTemplate($name, $index = NULL) {
if (!class_exists($cls, FALSE)) {
$cache_filename = $this->getCacheFilename($name);
if ($cache_filename === FALSE) {
$compiled_source = $this->compileSource($this->loader->getSource($name), $name);
eval('?' . '>' . $compiled_source);
}
else {
if ($cache_filename !== FALSE) {
// If autoreload is on, check that the template has not been
// modified since the last compilation.
if ($this->isAutoReload() && !$this->isFresh($cache_filename, $name)) {
......@@ -136,6 +131,10 @@ public function loadTemplate($name, $index = NULL) {
$this->storage()->load($cache_filename);
}
}
if (!class_exists($cls, FALSE)) {
$compiled_source = $this->compileSource($this->loader->getSource($name), $name);
eval('?' . '>' . $compiled_source);
}
}
if (!$this->runtimeInitialized) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment