diff --git a/CHANGELOG b/CHANGELOG index 3348fc208..209a5fb57 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ * 1.38.3 (2019-XX-XX) - * n/a + * fixed the bundled Autoloader to also load namespaced classes * 1.38.2 (2019-03-12) diff --git a/lib/Twig/Autoloader.php b/lib/Twig/Autoloader.php index 633d7a582..e34e2144f 100644 --- a/lib/Twig/Autoloader.php +++ b/lib/Twig/Autoloader.php @@ -45,6 +45,8 @@ class Twig_Autoloader if (is_file($file = __DIR__.'/../'.str_replace(['_', "\0"], ['/', ''], $class).'.php')) { require $file; + } elseif (is_file($file = __DIR__.'/../../src/'.str_replace(['Twig\\', '\\', "\0"], ['', '/', ''], $class).'.php')) { + require $file; } } }