Opened 4 years ago

#2808 new defect

Missing Template Blocks Cause Fatal Error

Reported by: reto.kohli Owned by: comvation
Priority: normal Milestone:
Component: News Version: 4.0
Severity: normal Keywords: news template block headlines_row missing fatal error
Cc:

Description

Components may try to parse Sigma Template blocks without testing for their existence first. When such blocks are missing, this causes fatal errors.

For example, core_modules/news/lib/headlines.class.php could be patched like this:

    function getHomeHeadlines($catId=0)
    {
        global $_CORELANG, $objDatabase, $_LANGID;

        $this->_objTemplate->setTemplate($this->_pageContent, true, true);

// Test first:
        if (!$this->_objTemplate->blockExists('headlines_row')) {
            return '';
        }

        $i = 0;
        // [...]

The same problem may exist in other components.

Change History (0)

Note: See TracTickets for help on using tickets.