Zend Framework

Dispatcher : include_once statement can generate a Warning if the file does not exists

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.5
  • Fix Version/s: 1.10.0
  • Component/s: Zend_Controller
  • Labels:
    None
  • Fix Version Priority:
    Must Have

Description

The following (around line 337) from Zend_Controller_Dispatcher_Standard should be refactored:

$dispatchDir = $this->getDispatchDirectory();
        $loadFile    = $dispatchDir . DIRECTORY_SEPARATOR . $this->classToFilename($className);

        if (!include_once $loadFile) {
            require_once 'Zend/Controller/Dispatcher/Exception.php';
            throw new Zend_Controller_Dispatcher_Exception('Cannot load controller class "' . $className . '" from file "' . $loadFile . "'");
        }

include_once statement can generate a Warning if the file does not exists
It should be @include_once or check with file_exists

Activity

Hide
Raphael Dehousse added a comment -

I'm not able to reopen the issue ZF-4736

So, I clone it to say :

Hello,

This issue should be reopened because the include_once statement can generate a Warning if the file does not exists.
It should be @include_once or check with file_exists

Thanks to fix this

Cheers,

Raphaël Dehousse

Show
Raphael Dehousse added a comment - I'm not able to reopen the issue ZF-4736 So, I clone it to say : Hello, This issue should be reopened because the include_once statement can generate a Warning if the file does not exists. It should be @include_once or check with file_exists Thanks to fix this Cheers, Raphaël Dehousse
Hide
Marco Kaiser added a comment -

fixed with r19092

Show
Marco Kaiser added a comment - fixed with r19092
Hide
Matthew Weier O'Phinney added a comment -

Marco – please modify this to use Zend_Loader::isReadable() in place of file_exists. file_exists() does not take into account the include_path, and as such could generate a false negative.

Show
Matthew Weier O'Phinney added a comment - Marco – please modify this to use Zend_Loader::isReadable() in place of file_exists. file_exists() does not take into account the include_path, and as such could generate a false negative.
Hide
Marco Kaiser added a comment -

fixed with r19235

Show
Marco Kaiser added a comment - fixed with r19235

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
15m
Original Estimate - 15 minutes
Remaining:
15m
Remaining Estimate - 15 minutes
Logged:
Not Specified
Time Spent - Not Specified