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
67d677b2
Commit
67d677b2
authored
Jun 05, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed Request::getRequestMethod() to Request::getMethod().
parent
e45e26ea
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
11 deletions
+11
-11
AccessRule.php
framework/yii/web/AccessRule.php
+1
-1
HttpCache.php
framework/yii/web/HttpCache.php
+1
-1
Request.php
framework/yii/web/Request.php
+7
-7
UrlRule.php
framework/yii/web/UrlRule.php
+1
-1
VerbFilter.php
framework/yii/web/VerbFilter.php
+1
-1
No files found.
framework/yii/web/AccessRule.php
View file @
67d677b2
...
...
@@ -99,7 +99,7 @@ class AccessRule extends Component
if
(
$this
->
matchAction
(
$action
)
&&
$this
->
matchRole
(
$user
)
&&
$this
->
matchIP
(
$request
->
getUserIP
())
&&
$this
->
matchVerb
(
$request
->
get
Request
Method
())
&&
$this
->
matchVerb
(
$request
->
getMethod
())
&&
$this
->
matchController
(
$action
->
controller
)
&&
$this
->
matchCustom
(
$action
)
)
{
...
...
framework/yii/web/HttpCache.php
View file @
67d677b2
...
...
@@ -60,7 +60,7 @@ class HttpCache extends ActionFilter
*/
public
function
beforeAction
(
$action
)
{
$verb
=
Yii
::
$app
->
request
->
get
Request
Method
();
$verb
=
Yii
::
$app
->
request
->
getMethod
();
if
(
$verb
!==
'GET'
&&
$verb
!==
'HEAD'
||
$this
->
lastModified
===
null
&&
$this
->
etagSeed
===
null
)
{
return
true
;
}
...
...
framework/yii/web/Request.php
View file @
67d677b2
...
...
@@ -49,7 +49,7 @@ class Request extends \yii\base\Request
/**
* @var string|boolean the name of the POST parameter that is used to indicate if a request is a PUT or DELETE
* request tunneled through POST. Default to '_method'.
* @see get
Request
Method
* @see getMethod
* @see getRestParams
*/
public
$restVar
=
'_method'
;
...
...
@@ -81,7 +81,7 @@ class Request extends \yii\base\Request
* @return string request method, such as GET, POST, HEAD, PUT, DELETE.
* The value returned is turned into upper case.
*/
public
function
get
Request
Method
()
public
function
getMethod
()
{
if
(
isset
(
$_POST
[
$this
->
restVar
]))
{
return
strtoupper
(
$_POST
[
$this
->
restVar
]);
...
...
@@ -96,7 +96,7 @@ class Request extends \yii\base\Request
*/
public
function
getIsPostRequest
()
{
return
$this
->
get
Request
Method
()
===
'POST'
;
return
$this
->
getMethod
()
===
'POST'
;
}
/**
...
...
@@ -105,7 +105,7 @@ class Request extends \yii\base\Request
*/
public
function
getIsDeleteRequest
()
{
return
$this
->
get
Request
Method
()
===
'DELETE'
;
return
$this
->
getMethod
()
===
'DELETE'
;
}
/**
...
...
@@ -114,7 +114,7 @@ class Request extends \yii\base\Request
*/
public
function
getIsPutRequest
()
{
return
$this
->
get
Request
Method
()
===
'PUT'
;
return
$this
->
getMethod
()
===
'PUT'
;
}
/**
...
...
@@ -141,7 +141,7 @@ class Request extends \yii\base\Request
/**
* Returns the request parameters for the RESTful request.
* @return array the RESTful request parameters
* @see get
Request
Method
* @see getMethod
*/
public
function
getRestParams
()
{
...
...
@@ -772,7 +772,7 @@ class Request extends \yii\base\Request
if
(
!
$this
->
enableCsrfValidation
)
{
return
;
}
$method
=
$this
->
get
Request
Method
();
$method
=
$this
->
getMethod
();
if
(
$method
===
'POST'
||
$method
===
'PUT'
||
$method
===
'DELETE'
)
{
$cookies
=
$this
->
getCookies
();
switch
(
$method
)
{
...
...
framework/yii/web/UrlRule.php
View file @
67d677b2
...
...
@@ -171,7 +171,7 @@ class UrlRule extends Object
return
false
;
}
if
(
$this
->
verb
!==
null
&&
!
in_array
(
$request
->
get
Request
Method
(),
$this
->
verb
,
true
))
{
if
(
$this
->
verb
!==
null
&&
!
in_array
(
$request
->
getMethod
(),
$this
->
verb
,
true
))
{
return
false
;
}
...
...
framework/yii/web/VerbFilter.php
View file @
67d677b2
...
...
@@ -76,7 +76,7 @@ class VerbFilter extends Behavior
{
$action
=
$event
->
action
->
id
;
if
(
isset
(
$this
->
actions
[
$action
]))
{
$verb
=
Yii
::
$app
->
getRequest
()
->
get
Request
Method
();
$verb
=
Yii
::
$app
->
getRequest
()
->
getMethod
();
$allowed
=
array_map
(
'strtoupper'
,
$this
->
actions
[
$action
]);
if
(
!
in_array
(
$verb
,
$allowed
))
{
$event
->
isValid
=
false
;
...
...
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