Skip to content
Snippets Groups Projects
Commit 7595aa78 authored by Alex Pott's avatar Alex Pott
Browse files

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
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment