Zend Framework

Zend_Log::_constructWriterFromConfig(), undefined variable $writerName

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::_constructWriterFromConfig($config);

on line 135, the variable $writerName is undefined and on line 132 parentheses are missing.

if (!$writer instanceof Zend_Log_Writer_Abstract) {
    /** @see Zend_Log_Exception */
    require_once 'Zend/Log/Exception.php';
    throw new Zend_Log_Exception("{$writerName} does not extend Zend_Log_Writer_Abstract!");
}

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

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

Activity

Hide
Ramon Henrique Ornelas added a comment -

Fixed in trunk revision r22524.

Show
Ramon Henrique Ornelas added a comment - Fixed in trunk revision r22524.
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: