Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("imagecreatefrompng(): gd-png: fatal libpng error: bad adaptive filter value").
Previous exceptions
  • imagecreatefrompng(): gd-png: fatal libpng error: bad adaptive filter value (2)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("imagecreatefrompng(): gd-png: fatal libpng error: bad adaptive filter value")." Stacktrace: #28 Twig\Error\RuntimeError in /var/www/html/public/content/themes/pbc/templates/atoms/image.twig:12 #27 Whoops\Exception\ErrorException in /var/www/html/vendor/timber/timber/lib/Image/Operation/ToJpg.php:67 #26 imagecreatefrompng in /var/www/html/vendor/timber/timber/lib/Image/Operation/ToJpg.php:67 #25 Timber\Image\Operation\ToJpg:run in /var/www/html/vendor/timber/timber/lib/ImageHelper.php:624 #24 Timber\ImageHelper:_operate in /var/www/html/vendor/timber/timber/lib/ImageHelper.php:204 #23 Timber\ImageHelper:img_to_jpg in /var/www/html/vendor/twig/twig/src/Environment.php:418 #22 __TwigTemplate_5f4183a88671eb44d7364d4bbd11db884974e78fca70a8357e4bd9715f2a3daa:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #21 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #20 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #19 __TwigTemplate_11d3bf8d4d7ed822651d9ddc61851ed770a4526ac1c01129b33cfbadb87b4ad7:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #18 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #17 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #16 __TwigTemplate_b45a6c4b5258b57ddd025e086475a9a05720dd8d2af849548fc120acc5fc27df:block_content in /var/www/html/vendor/twig/twig/src/Template.php:182 #15 Twig\Template:displayBlock in /var/www/html/vendor/twig/twig/src/Environment.php:418 #14 __TwigTemplate_ca6e76fb8f74660c3f29ac6df7f0e2c9cf52224d5eadac483688adde90d12aa0:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #13 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #12 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Environment.php:418 #11 __TwigTemplate_b45a6c4b5258b57ddd025e086475a9a05720dd8d2af849548fc120acc5fc27df:doDisplay in /var/www/html/vendor/twig/twig/src/Template.php:405 #10 Twig\Template:displayWithErrorHandling in /var/www/html/vendor/twig/twig/src/Template.php:378 #9 Twig\Template:display in /var/www/html/vendor/twig/twig/src/Template.php:390 #8 Twig\Template:render in /var/www/html/vendor/twig/twig/src/TemplateWrapper.php:45 #7 Twig\TemplateWrapper:render in /var/www/html/vendor/timber/timber/lib/Loader.php:79 #6 Timber\Loader:render in /var/www/html/vendor/timber/timber/lib/Timber.php:334 #5 Timber\Timber:compile in /var/www/html/vendor/timber/timber/lib/Timber.php:383 #4 Timber\Timber:fetch in /var/www/html/vendor/timber/timber/lib/Timber.php:410 #3 Timber\Timber:render in /var/www/html/public/content/themes/pbc/archive.php:52 #2 include in /var/www/html/public/wordpress/wp-includes/template-loader.php:106 #1 require_once in /var/www/html/public/wordpress/wp-blog-header.php:19 #0 require in /var/www/html/public/index.php:14
28
Twig\Error\RuntimeError
/public/content/themes/pbc/templates/atoms/image.twig12
27
Whoops\Exception\ErrorException
/vendor/timber/timber/lib/Image/Operation/ToJpg.php67
26
imagecreatefrompng
/vendor/timber/timber/lib/Image/Operation/ToJpg.php67
25
Timber\Image\Operation\ToJpg run
/vendor/timber/timber/lib/ImageHelper.php624
24
Timber\ImageHelper _operate
/vendor/timber/timber/lib/ImageHelper.php204
23
Timber\ImageHelper img_to_jpg
/vendor/twig/twig/src/Environment.php418
22
__TwigTemplate_5f4183a88671eb44d7364d4bbd11db884974e78fca70a8357e4bd9715f2a3daa doDisplay
/vendor/twig/twig/src/Template.php405
21
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
20
Twig\Template display
/vendor/twig/twig/src/Environment.php418
19
__TwigTemplate_11d3bf8d4d7ed822651d9ddc61851ed770a4526ac1c01129b33cfbadb87b4ad7 doDisplay
/vendor/twig/twig/src/Template.php405
18
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
17
Twig\Template display
/vendor/twig/twig/src/Environment.php418
16
__TwigTemplate_b45a6c4b5258b57ddd025e086475a9a05720dd8d2af849548fc120acc5fc27df block_content
/vendor/twig/twig/src/Template.php182
15
Twig\Template displayBlock
/vendor/twig/twig/src/Environment.php418
14
__TwigTemplate_ca6e76fb8f74660c3f29ac6df7f0e2c9cf52224d5eadac483688adde90d12aa0 doDisplay
/vendor/twig/twig/src/Template.php405
13
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
12
Twig\Template display
/vendor/twig/twig/src/Environment.php418
11
__TwigTemplate_b45a6c4b5258b57ddd025e086475a9a05720dd8d2af849548fc120acc5fc27df doDisplay
/vendor/twig/twig/src/Template.php405
10
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
9
Twig\Template display
/vendor/twig/twig/src/Template.php390
8
Twig\Template render
/vendor/twig/twig/src/TemplateWrapper.php45
7
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php79
6
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
5
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
4
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
3
Timber\Timber render
/public/content/themes/pbc/archive.php52
2
include
/public/wordpress/wp-includes/template-loader.php106
1
require_once
/public/wordpress/wp-blog-header.php19
0
require
/public/index.php14
/var/www/html/public/content/themes/pbc/templates/atoms/image.twig
{% set image = Image(item) %}
<div class="{{parentClasses}}{% if item.border %} image-container--border{% endif %}{% if item.alignment %} image-container--align-{{item.alignment}}{% endif %}{% if item.objectFit %} img-fit-{{item.objectFit}}{% endif %}" {{replacement|default('replace-image')}}>
    {% if image.src or image.source_url %}
        {% set main_img_src = image_size ? image.src(image_size)|default(image.source_url(image_size)) : image.src|default(image.source_url) %}
        {% if link %}
            <a href="{{link.url|default(link)}}" target="{{link.target}}">
        {% endif %}
            {% block beforeImage %}
            {% endblock %}
            <img
                srcset = "{{image.srcset|tojpg}}"
                src="{{ main_img_src|tojpg }}" 
                alt="{{item.alt}}"
                class="{{childClasses}}"
                loading="lazy"
            />
            {% block afterImage %}
            {% endblock %}
        {% if link %}
            </a>
        {% endif %}
    {% endif %}
</div>
/var/www/html/vendor/timber/timber/lib/Image/Operation/ToJpg.php
        }
        
        // Attempt to check if SVG.
        if ( ImageHelper::is_svg($load_filename) ) {
            return false;
        }
 
        $ext = wp_check_filetype($load_filename);
        if ( isset($ext['ext']) ) {
            $ext = $ext['ext'];
        }
        $ext = strtolower($ext);
        $ext = str_replace('jpg', 'jpeg', $ext);
 
        $imagecreate_function = 'imagecreatefrom' . $ext;
        if ( !function_exists($imagecreate_function) ) {
            return false;
        }
 
        $input = $imagecreate_function($load_filename);
 
        list($width, $height) = getimagesize($load_filename);
        $output = imagecreatetruecolor($width, $height);
        $c = self::hexrgb($this->color);
        $color = imagecolorallocate($output, $c['red'], $c['green'], $c['blue']);
        imagefilledrectangle($output, 0, 0, $width, $height, $color);
        imagecopy($output, $input, 0, 0, 0, 0, $width, $height);
        imagejpeg($output, $save_filename);
        return true;
    }
 
}
 
Exception message: imagecreatefrompng(): gd-png: fatal libpng error: bad adaptive filter value
/var/www/html/vendor/timber/timber/lib/Image/Operation/ToJpg.php
        }
        
        // Attempt to check if SVG.
        if ( ImageHelper::is_svg($load_filename) ) {
            return false;
        }
 
        $ext = wp_check_filetype($load_filename);
        if ( isset($ext['ext']) ) {
            $ext = $ext['ext'];
        }
        $ext = strtolower($ext);
        $ext = str_replace('jpg', 'jpeg', $ext);
 
        $imagecreate_function = 'imagecreatefrom' . $ext;
        if ( !function_exists($imagecreate_function) ) {
            return false;
        }
 
        $input = $imagecreate_function($load_filename);
 
        list($width, $height) = getimagesize($load_filename);
        $output = imagecreatetruecolor($width, $height);
        $c = self::hexrgb($this->color);
        $color = imagecolorallocate($output, $c['red'], $c['green'], $c['blue']);
        imagefilledrectangle($output, 0, 0, $width, $height, $color);
        imagecopy($output, $input, 0, 0, 0, 0, $width, $height);
        imagejpeg($output, $save_filename);
        return true;
    }
 
}
 
/var/www/html/vendor/timber/timber/lib/ImageHelper.php
        $source_path = self::_get_file_path(
            $au['base'],
            $au['subdir'],
            $au['basename']
        );
 
        $new_url = apply_filters('timber/image/new_url', $new_url);
        $destination_path = apply_filters('timber/image/new_path', $destination_path);
        // if already exists...
        if ( file_exists($source_path) && file_exists($destination_path) ) {
            if ( $force || filemtime($source_path) > filemtime($destination_path) ) {
                // Force operation - warning: will regenerate the image on every pageload, use for testing purposes only!
                unlink($destination_path);
            } else {
                // return existing file (caching)
                return $new_url;
            }
        }
        // otherwise generate result file
        if ( $op->run($source_path, $destination_path) ) {
            if ( get_class($op) === 'Timber\Image\Operation\Resize' && $external ) {
                $new_url = strtolower($new_url);
            }
            return $new_url;
        } else {
            // in case of error, we return source file itself
            return $src;
        }
    }
 
 
// -- the below methods are just used for unit testing the URL generation code
//
    public static function get_letterbox_file_url( $url, $w, $h, $color ) {
        $au = self::analyze_url($url);
        $op = new Image\Operation\Letterbox($w, $h, $color);
        $new_url = self::_get_file_url(
            $au['base'],
            $au['subdir'],
            $op->filename($au['filename'], $au['extension']),
/var/www/html/vendor/timber/timber/lib/ImageHelper.php
     * @param int     $h
     * @param string  $color
     * @param bool    $force
     * @return string
     */
    public static function letterbox( $src, $w, $h, $color = false, $force = false ) {
        $op = new Letterbox($w, $h, $color);
        return self::_operate($src, $op, $force);
    }
 
    /**
     * Generates a new image by converting the source GIF or PNG into JPG
     *
     * @param string  $src   a url or path to the image (http://example.org/wp-content/uploads/2014/image.jpg) or (/wp-content/uploads/2014/image.jpg)
     * @param string  $bghex
     * @return string
     */
    public static function img_to_jpg( $src, $bghex = '#FFFFFF', $force = false ) {
        $op = new Image\Operation\ToJpg($bghex);
        return self::_operate($src, $op, $force);
    }
 
    /**
     * Generates a new image by converting the source into WEBP if supported by the server
     *
     * @param string  $src      a url or path to the image (http://example.org/wp-content/uploads/2014/image.webp)
     *                            or (/wp-content/uploads/2014/image.jpg)
     *                            If webp is not supported, a jpeg image will be generated
     * @param int     $quality  ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file)
     * @param bool    $force
     */
    public static function img_to_webp( $src, $quality = 80, $force = false ) {
        $op = new Image\Operation\ToWebp($quality);
        return self::_operate($src, $op, $force);
    }
 
    //-- end of public methods --//
 
    /**
     * Deletes all resized versions of an image when the source is deleted.
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
    {
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false, $templateContext ?? $this);
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $this->cache->write($key, $content);
                $this->cache->load($key);
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
 
                if (!class_exists($cls, false)) {
                    throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
     * @param string $template The template source
/var/www/html/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
/var/www/html/vendor/twig/twig/src/Template.php
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/html/vendor/twig/twig/src/Template.php
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
/var/www/html/vendor/twig/twig/src/TemplateWrapper.php
     * directly (use Twig\Environment::load() instead).
     *
     * @internal
     */
    public function __construct(Environment $env, Template $template)
    {
        $this->env = $env;
        $this->template = $template;
    }
 
    /**
     * Renders the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function render(array $context = []): string
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        return $this->template->render($context, \func_get_args()[1] ?? []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display(array $context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        $this->template->display($context, \func_get_args()[1] ?? []);
    }
 
    /**
     * Checks if a block is defined.
     *
     * @param string $name    The block name
     * @param array  $context An array of parameters to pass to the template
     */
/var/www/html/vendor/timber/timber/lib/Loader.php
 
        $key = null;
        $output = false;
        if ( false !== $expires ) {
            ksort($data);
            $key = md5($file.json_encode($data));
            $output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
        }
 
        if ( false === $output || null === $output ) {
            $twig = $this->get_twig();
            if ( strlen($file) ) {
                $loader = $this->get_loader();
                $result = $loader->getCacheKey($file);
                do_action('timber_loader_render_file', $result);
            }
            $data = apply_filters('timber_loader_render_data', $data);
            $data = apply_filters('timber/loader/render_data', $data, $file);
            $template = $twig->load($file);
            $output = $template->render($data);
        }
 
        if ( false !== $output && false !== $expires && null !== $key ) {
            $this->delete_cache();
            $this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
        }
        $output = apply_filters('timber_output', $output);
        return apply_filters('timber/output', $output, $data, $file);
    }
 
    protected function delete_cache() {
        Cleaner::delete_transients();
    }
 
    /**
     * Get first existing template.
     *
     * @param array|string $templates  Name(s) of the Twig template(s) to choose from.
     * @return string|bool             Name of chosen template, otherwise false.
     */
/var/www/html/vendor/timber/timber/lib/Timber.php
        if ( $via_render ) {
            $file = apply_filters('timber_render_file', $file);
        } else {
            $file = apply_filters('timber_compile_file', $file);
        }
 
        $output = false;
 
        if ($file !== false) {
            if ( is_null($data) ) {
                $data = array();
            }
 
            if ( $via_render ) {
                $data = apply_filters('timber_render_data', $data);
            } else {
                $data = apply_filters('timber_compile_data', $data);
            }
 
            $output = $loader->render($file, $data, $expires, $cache_mode);
        } else {
            if ( is_array($filenames) ) {
                $filenames = implode(", ", $filenames);
            }
            Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
        }
 
        do_action('timber_compile_done');
        return $output;
    }
 
    /**
     * Compile a string.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
/var/www/html/vendor/timber/timber/lib/Timber.php
        $twig = $dummy_loader->get_twig();
        $template = $twig->createTemplate($string);
        return $template->render($data);
    }
 
    /**
     * Fetch function.
     *
     * @api
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The returned output.
     */
    public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::compile($filenames, $data, $expires, $cache_mode, true);
        $output = apply_filters('timber_compile_result', $output);
        return $output;
    }
 
    /**
     * Render function.
     *
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
/var/www/html/vendor/timber/timber/lib/Timber.php
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The echoed output.
     */
    public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::fetch($filenames, $data, $expires, $cache_mode);
        echo $output;
        return $output;
    }
 
    /**
     * Render a string with Twig variables.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
     *
     * Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
     * ```
     * @param string $string A string with Twig variables.
     * @param array  $data   An array of data to use in Twig template.
     * @return bool|string
     */
/var/www/html/public/content/themes/pbc/archive.php
    $context['description'] = term_description();
} else if ( is_category() ) {
    $context['category']['name'] = single_cat_title( '', false );
    $context['title'] = $context['category']['name'];
    $context['description'] = term_description();
    array_unshift( $templates, 'archive-' . get_query_var( 'cat' ) . '.twig' );
} else if ( is_post_type_archive() ) {
    $context['title'] = post_type_archive_title( '', false );
    array_unshift( $templates, 'archive-' . get_post_type() . '.twig' );
}
 
 
pbc_augment_timber_pagination($context);
 
$category = isset(get_queried_object()->term_id) ? get_queried_object()->term_id : '';
 
 
$context['sidebar'] = Timber::get_sidebar('sidebar.php', $context);
 
Timber::render( $templates, $context );
/var/www/html/public/wordpress/wp-includes/template-loader.php
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
/var/www/html/public/wordpress/wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
/var/www/html/public/index.php
<?php
 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
 
// WordPress view bootstrapper
define( 'WP_USE_THEMES', true );
 
// composer auto loader, symlinks all colliding, this should resolve the relative include paths correctly
//chdir( dirname ( realpath ( __FILE__ ) ) );
 
//require( '../vendor/autoload.php' );
require( './wordpress/wp-blog-header.php');

Environment & details:

empty
empty
empty
empty
Key Value
signup-auth 18550462586097423386ab73.80218838
Key Value
SERVER_SOFTWARE nginx/1.16.1
REQUEST_URI /category/other/page/3
FILE_SYSTEM_ID fs-89b1acbc
WP_HOME **********************************
HOSTNAME ************
PHP_INI_DIR *********
MOUNT_DIRECTORY /efs
SHLVL *
HOME *****
DB_NAME *************
WP_ENV **********
COMPOSER_ALLOW_SUPERUSER *
DB_HOST_RO prospect-live-new-cluster.cluster-ro-confjboupptb.eu-west-1.rds.amazonaws.com:3306
PATH ************************************************************
WP_SITEURL ********************************************
WP_REDIS_HOST prospect-redis-cache.eui3wf.0001.euw1.cache.amazonaws.com
MAGICK_HOME ****
GOOGLE_AD_MANAGER_ACTIVE true
SESSION_SAVE_HANDLER redis
DB_PASSWORD ******************
PWD *************
GOOGLE_AD_MANAGER_ID 21688349148
DB_HOST *******************************************************************************
DB_USER ***************
VIPSHOME /usr
HTTP_ACCEPT_ENCODING br,gzip
HTTP_IF_MODIFIED_SINCE Sun, 12 Jul 2020 04:31:01 GMT
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_X_AMZN_TRACE_ID Root=1-60974233-73d2938a09c446cf1a6e5f05
HTTP_HOST www.prospectmagazine.co.uk
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 3.237.48.165
REDIRECT_STATUS 200
SERVER_NAME _
SERVER_PORT 443
SERVER_ADDR 172.17.0.2
REMOTE_PORT 21394
REMOTE_ADDR 172.31.26.235
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT ********************
DOCUMENT_URI /index.php
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME ******************************
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1620525619.539
REQUEST_TIME 1620525619
Key Value
FILE_SYSTEM_ID fs-89b1acbc
WP_HOME **********************************
HOSTNAME ************
PHP_INI_DIR *********
MOUNT_DIRECTORY /efs
SHLVL *
HOME *****
DB_NAME *************
WP_ENV **********
COMPOSER_ALLOW_SUPERUSER *
DB_HOST_RO prospect-live-new-cluster.cluster-ro-confjboupptb.eu-west-1.rds.amazonaws.com:3306
PATH ************************************************************
WP_SITEURL ********************************************
WP_REDIS_HOST prospect-redis-cache.eui3wf.0001.euw1.cache.amazonaws.com
MAGICK_HOME ****
GOOGLE_AD_MANAGER_ACTIVE true
SESSION_SAVE_HANDLER redis
DB_PASSWORD ******************
PWD *************
GOOGLE_AD_MANAGER_ID 21688349148
DB_HOST *******************************************************************************
DB_USER ***************
VIPSHOME /usr
HTTP_ACCEPT_ENCODING br,gzip
HTTP_IF_MODIFIED_SINCE Sun, 12 Jul 2020 04:31:01 GMT
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_X_AMZN_TRACE_ID Root=1-60974233-73d2938a09c446cf1a6e5f05
HTTP_HOST www.prospectmagazine.co.uk
HTTP_X_FORWARDED_PORT 443
HTTP_X_FORWARDED_PROTO https
HTTP_X_FORWARDED_FOR 3.237.48.165
REDIRECT_STATUS 200
SERVER_NAME _
SERVER_PORT 443
SERVER_ADDR 172.17.0.2
REMOTE_PORT 21394
REMOTE_ADDR 172.31.26.235
SERVER_SOFTWARE nginx/1.16.1
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /var/www/html/public
DOCUMENT_URI /index.php
REQUEST_URI /category/other/page/3
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING
SCRIPT_FILENAME /var/www/html/public/index.php
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1620525619.539
REQUEST_TIME 1620525619
0. Whoops\Handler\PrettyPageHandler