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
50fd1f58
Commit
50fd1f58
authored
Oct 24, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug: `yii\web\UrlRule` was unable to create URLs for rules containing unicode characters
parent
99a818c0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
1 deletion
+12
-1
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
UrlRule.php
framework/web/UrlRule.php
+1
-1
UrlRuleTest.php
tests/unit/framework/web/UrlRuleTest.php
+10
-0
No files found.
framework/CHANGELOG.md
View file @
50fd1f58
...
...
@@ -14,6 +14,7 @@ Yii Framework 2 Change Log
-
Bug #5682: The
`asset`
command would incorrectly combine CSS files when
`UrlManager::linkAssets`
is true (dmvslv)
-
Bug #5702: Parenthesis should be automatically added to
`Validator::whenClient`
to avoid js error (mdmunir, qiangxue)
-
Bug: Gii console command help information does not contain global options (qiangxue)
-
Bug:
`yii\web\UrlRule`
was unable to create URLs for rules containing unicode characters (samdark)
-
Enh #5223: Query builder now supports selecting sub-queries as columns (qiangxue)
-
Enh #5587:
`json_encode`
is now used with
`JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE`
where it makes sense, also
it is now default for
`Json::encode()`
(samdark)
...
...
framework/web/UrlRule.php
View file @
50fd1f58
...
...
@@ -185,7 +185,7 @@ class UrlRule extends Object implements UrlRuleInterface
if
(
isset
(
$this
->
_routeParams
[
$name
]))
{
$tr2
[
"<
$name
>"
]
=
"(?P<
$name
>
$pattern
)"
;
}
else
{
$this
->
_paramRules
[
$name
]
=
$pattern
===
'[^\/]+'
?
''
:
"#^
$pattern
$#"
;
$this
->
_paramRules
[
$name
]
=
$pattern
===
'[^\/]+'
?
''
:
"#^
$pattern
$#
u
"
;
}
}
}
...
...
tests/unit/framework/web/UrlRuleTest.php
View file @
50fd1f58
...
...
@@ -362,6 +362,16 @@ class UrlRuleTest extends TestCase
[
'post/index'
,
[
'page'
=>
1
,
'tag'
=>
'a'
,
'lang'
=>
'en'
],
'http://en.example.com/post/a'
],
],
],
[
'with unicode'
,
[
'pattern'
=>
'/blog/search/<tag:[a-zA-Zа-яА-Я0-9\_\+\-]{1,255}>'
,
'route'
=>
'blog/search'
,
],
[
[
'blog/search'
,
[
'tag'
=>
'метра'
],
'blog/search/%D0%BC%D0%B5%D1%82%D1%80%D0%B0'
],
],
],
];
}
...
...
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