Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
ebe31c5f
Commit
ebe31c5f
authored
May 23, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes issue 380: invalid route exception should be 404.
parent
0884a70b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
Application.php
framework/yii/web/Application.php
+7
-0
No files found.
framework/yii/web/Application.php
View file @
ebe31c5f
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
namespace
yii\web
;
namespace
yii\web
;
use
Yii
;
use
Yii
;
use
yii\base\HttpException
;
use
yii\base\InvalidRouteException
;
/**
/**
* Application is the base class for all application classes.
* Application is the base class for all application classes.
...
@@ -25,6 +27,7 @@ class Application extends \yii\base\Application
...
@@ -25,6 +27,7 @@ class Application extends \yii\base\Application
/**
/**
* Processes the request.
* Processes the request.
* @return integer the exit status of the controller action (0 means normal, non-zero values mean abnormal)
* @return integer the exit status of the controller action (0 means normal, non-zero values mean abnormal)
* @throws HttpException if the request cannot be resolved.
*/
*/
public
function
processRequest
()
public
function
processRequest
()
{
{
...
@@ -32,7 +35,11 @@ class Application extends \yii\base\Application
...
@@ -32,7 +35,11 @@ class Application extends \yii\base\Application
Yii
::
setAlias
(
'@wwwroot'
,
dirname
(
$request
->
getScriptFile
()));
Yii
::
setAlias
(
'@wwwroot'
,
dirname
(
$request
->
getScriptFile
()));
Yii
::
setAlias
(
'@www'
,
$request
->
getBaseUrl
());
Yii
::
setAlias
(
'@www'
,
$request
->
getBaseUrl
());
list
(
$route
,
$params
)
=
$request
->
resolve
();
list
(
$route
,
$params
)
=
$request
->
resolve
();
try
{
return
$this
->
runAction
(
$route
,
$params
);
return
$this
->
runAction
(
$route
,
$params
);
}
catch
(
InvalidRouteException
$e
)
{
throw
new
HttpException
(
404
,
$e
->
getMessage
(),
$e
->
getCode
(),
$e
);
}
}
}
private
$_homeUrl
;
private
$_homeUrl
;
...
...
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