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
a2c483fc
Commit
a2c483fc
authored
Aug 03, 2014
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4582 from tadaszelvys/4581-urlrule-encode-params
Enh #4581: Added ability to disable url encoding in `UrlRule`.
parents
89386e7c
f010fb57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
UrlRule.php
framework/web/UrlRule.php
+5
-1
No files found.
framework/CHANGELOG.md
View file @
a2c483fc
...
@@ -169,6 +169,7 @@ Yii Framework 2 Change Log
...
@@ -169,6 +169,7 @@ Yii Framework 2 Change Log
-
Enh #4485: Added support for deferred validation in
`ActiveForm`
(Alex-Code)
-
Enh #4485: Added support for deferred validation in
`ActiveForm`
(Alex-Code)
-
Enh #4520: Added sasl support to
`yii\caching\MemCache`
(xjflyttp)
-
Enh #4520: Added sasl support to
`yii\caching\MemCache`
(xjflyttp)
-
Enh #4566: Added client validation support for image validator (Skysplit, qiangxue)
-
Enh #4566: Added client validation support for image validator (Skysplit, qiangxue)
-
Enh #4581: Added ability to disable url encoding in
`UrlRule`
(tadaszelvys)
-
Enh: Added support for using sub-queries when building a DB query with
`IN`
condition (qiangxue)
-
Enh: Added support for using sub-queries when building a DB query with
`IN`
condition (qiangxue)
-
Enh: Supported adding a new response formatter without the need to reconfigure existing formatters (qiangxue)
-
Enh: Supported adding a new response formatter without the need to reconfigure existing formatters (qiangxue)
-
Enh: Added
`yii\web\UrlManager::addRules()`
to simplify adding new URL rules (qiangxue)
-
Enh: Added
`yii\web\UrlManager::addRules()`
to simplify adding new URL rules (qiangxue)
...
...
framework/web/UrlRule.php
View file @
a2c483fc
...
@@ -83,6 +83,10 @@ class UrlRule extends Object implements UrlRuleInterface
...
@@ -83,6 +83,10 @@ class UrlRule extends Object implements UrlRuleInterface
* If it is [[CREATION_ONLY]], the rule is for URL creation only.
* If it is [[CREATION_ONLY]], the rule is for URL creation only.
*/
*/
public
$mode
;
public
$mode
;
/**
* @var bool a value indicating if parameters should be url encoded.
*/
public
$encodeParams
=
true
;
/**
/**
* @var string the template for generating a new URL. This is derived from [[pattern]] and is used in generating URL.
* @var string the template for generating a new URL. This is derived from [[pattern]] and is used in generating URL.
...
@@ -310,7 +314,7 @@ class UrlRule extends Object implements UrlRuleInterface
...
@@ -310,7 +314,7 @@ class UrlRule extends Object implements UrlRuleInterface
// match params in the pattern
// match params in the pattern
foreach
(
$this
->
_paramRules
as
$name
=>
$rule
)
{
foreach
(
$this
->
_paramRules
as
$name
=>
$rule
)
{
if
(
isset
(
$params
[
$name
])
&&
!
is_array
(
$params
[
$name
])
&&
(
$rule
===
''
||
preg_match
(
$rule
,
$params
[
$name
])))
{
if
(
isset
(
$params
[
$name
])
&&
!
is_array
(
$params
[
$name
])
&&
(
$rule
===
''
||
preg_match
(
$rule
,
$params
[
$name
])))
{
$tr
[
"<
$name
>"
]
=
urlencode
(
$params
[
$name
])
;
$tr
[
"<
$name
>"
]
=
$this
->
encodeParams
?
urlencode
(
$params
[
$name
])
:
$params
[
$name
]
;
unset
(
$params
[
$name
]);
unset
(
$params
[
$name
]);
}
elseif
(
!
isset
(
$this
->
defaults
[
$name
])
||
isset
(
$params
[
$name
]))
{
}
elseif
(
!
isset
(
$this
->
defaults
[
$name
])
||
isset
(
$params
[
$name
]))
{
return
false
;
return
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