projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
1819d97
)
Prevent extensions from clobbering all globals.
author
Andrew Winter
<awinter@sbstrm.co.jp>
Fri, 12 Apr 2013 01:57:33 +0000 (10:57 +0900)
committer
Fabien Potencier
<fabien.potencier@gmail.com>
Fri, 12 Apr 2013 09:46:40 +0000 (11:46 +0200)
lib/Twig/Environment.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Environment.php
b/lib/Twig/Environment.php
index
ff089c2
..
32b026a
100644
(file)
--- a/
lib/Twig/Environment.php
+++ b/
lib/Twig/Environment.php
@@
-1099,7
+1099,12
@@
class Twig_Environment
{
$globals = array();
foreach ($this->extensions as $extension) {
- $globals = array_merge($globals, $extension->getGlobals());
+ $extGlob = $extension->getGlobals();
+ if (!is_array($extGlob)) {
+ throw new UnexpectedValueException(sprintf('"%s::getGlobals()" must return an array of globals.', get_class($extension)));
+ }
+
+ $globals = array_merge($globals, $extGlob);
}
return array_merge($globals, $this->staging->getGlobals());