mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-16 20:36:33 +00:00
Merge branch '2.x' into 3.x
* 2.x: Fix tests Updates CoreExtension::twig_constant to check for definition first to avoid hard crash
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
return [];
|
||||
--EXPECT--
|
||||
Aug 7, 2019, 11:39:12 PM
|
||||
7 août 2019 à 23:39:12
|
||||
7 août 2019, 23:39:12
|
||||
23:39
|
||||
07/08/2019
|
||||
mercredi 7 août 2019 à 23:39:12 Temps universel coordonné
|
||||
mercredi 7 août 2019 à 23:39:12 temps universel coordonné
|
||||
11 oclock PM, Coordinated Universal Time
|
||||
|
||||
Aug 7, 2019
|
||||
|
||||
@@ -1366,6 +1366,10 @@ function twig_constant($constant, $object = null)
|
||||
$constant = \get_class($object).'::'.$constant;
|
||||
}
|
||||
|
||||
if (!\defined($constant)) {
|
||||
throw new RuntimeError(sprintf('Constant "%s" is undefined.', $constant));
|
||||
}
|
||||
|
||||
return \constant($constant);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user