Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
afi
zf
Commits
78ee5819
Commit
78ee5819
authored
Oct 06, 2014
by
Laurent
Browse files
On disptacher error, raises error 404 instead of 500
parent
6489854c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
library/Zend/Controller/Dispatcher/Standard.php
library/Zend/Controller/Dispatcher/Standard.php
+5
-6
No files found.
library/Zend/Controller/Dispatcher/Standard.php
View file @
78ee5819
...
...
@@ -134,8 +134,8 @@ class Zend_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_Abs
/**
* Remove a controller directory by module name
*
* @param string $module
*
* @param string $module
* @return bool
*/
public
function
removeControllerDirectory
(
$module
)
...
...
@@ -230,7 +230,6 @@ class Zend_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_Abs
public
function
dispatch
(
Zend_Controller_Request_Abstract
$request
,
Zend_Controller_Response_Abstract
$response
)
{
$this
->
setResponse
(
$response
);
/**
* Get controller class
*/
...
...
@@ -238,7 +237,7 @@ class Zend_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_Abs
$controller
=
$request
->
getControllerName
();
if
(
!
$this
->
getParam
(
'useDefaultControllerAlways'
)
&&
!
empty
(
$controller
))
{
require_once
'Zend/Controller/Dispatcher/Exception.php'
;
throw
new
Zend_Controller_Dispatcher_Exception
(
'Invalid controller specified ('
.
$request
->
getControllerName
()
.
')'
);
throw
new
Zend_Controller_Dispatcher_Exception
(
'Invalid controller specified ('
.
$request
->
getControllerName
()
.
')'
,
404
);
}
$className
=
$this
->
getDefaultControllerClass
(
$request
);
...
...
@@ -319,8 +318,8 @@ class Zend_Controller_Dispatcher_Standard extends Zend_Controller_Dispatcher_Abs
public
function
loadClass
(
$className
)
{
$finalClass
=
$className
;
if
((
$this
->
_defaultModule
!=
$this
->
_curModule
)
||
$this
->
getParam
(
'prefixDefaultModule'
))
if
((
$this
->
_defaultModule
!=
$this
->
_curModule
)
||
$this
->
getParam
(
'prefixDefaultModule'
))
{
$finalClass
=
$this
->
formatClassName
(
$this
->
_curModule
,
$className
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment