Zend Framework

Zend_Log::_constructFilterFromConfig(), undefined variable $filterName, parentheses missing

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.10.5
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Log
  • Labels:
    None

Description

In

Zend_Log::_constructFilterFromConfig($config);

on line 159, the variable $filterName is undefined and an line 156 parentheses are missing.

if (!$filter instanceof Zend_Log_Filter_Interface) {
    /** @see Zend_Log_Exception */
    require_once 'Zend/Log/Exception.php';
    throw new Zend_Log_Exception("{$filterName} does not implement Zend_Log_Filter_Interface");
}

A fix could be (again, use of double quotation marks is discouraged, by the way):

if (!($filter instanceof Zend_Log_Filter_Interface)) {
    /** @see Zend_Log_Exception */
    require_once 'Zend/Log/Exception.php';
    $filterName = is_object($filter)
                ? get_class($filter)
                : 'The specified filter'
    ;
    throw new Zend_Log_Exception($filterName . 'does not implement Zend_Log_Filter_Interface.');
}

Activity

Hide
Ramon Henrique Ornelas added a comment -

Fixed in trunk r22526.

Show
Ramon Henrique Ornelas added a comment - Fixed in trunk r22526.
Hide
Ramon Henrique Ornelas added a comment -

Applied to branch release-1.10 r22527

Show
Ramon Henrique Ornelas added a comment - Applied to branch release-1.10 r22527

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: