Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9560031

Browse filesBrowse files
committed
[Routing] remove deprecated features
1 parent 089377f commit 9560031
Copy full SHA for 9560031

File tree

Expand file treeCollapse file tree

3 files changed

+9
-6
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-6
lines changed

‎src/Symfony/Component/Routing/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
CHANGELOG
22
=========
33

4+
4.0.0
5+
-----
6+
7+
* dropped support for using UTF-8 route patterns without using the `utf8` option
8+
* dropped support for using UTF-8 route requirements without using the `utf8` option
9+
410
3.3.0
511
-----
612

‎src/Symfony/Component/Routing/RouteCompiler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/RouteCompiler.php
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ private static function compilePattern(Route $route, $pattern, $isHost)
103103
$needsUtf8 = $route->getOption('utf8');
104104

105105
if (!$needsUtf8 && $useUtf8 && preg_match('/[\x80-\xFF]/', $pattern)) {
106-
$needsUtf8 = true;
107-
@trigger_error(sprintf('Using UTF-8 route patterns without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for pattern "%s".', $pattern), E_USER_DEPRECATED);
106+
throw new \LogicException(sprintf('Cannot use UTF-8 route patterns without setting the "utf8" option for route "%s".', $route->getPath()));
108107
}
109108
if (!$useUtf8 && $needsUtf8) {
110109
throw new \LogicException(sprintf('Cannot mix UTF-8 requirements with non-UTF-8 pattern "%s".', $pattern));
@@ -176,8 +175,7 @@ private static function compilePattern(Route $route, $pattern, $isHost)
176175
if (!preg_match('//u', $regexp)) {
177176
$useUtf8 = false;
178177
} elseif (!$needsUtf8 && preg_match('/[\x80-\xFF]|(?<!\\\\)\\\\(?:\\\\\\\\)*+(?-i:X|[pP][\{CLMNPSZ]|x\{[A-Fa-f0-9]{3})/', $regexp)) {
179-
$needsUtf8 = true;
180-
@trigger_error(sprintf('Using UTF-8 route requirements without setting the "utf8" option is deprecated since Symfony 3.2 and will throw a LogicException in 4.0. Turn on the "utf8" route option for variable "%s" in pattern "%s".', $varName, $pattern), E_USER_DEPRECATED);
178+
throw new \LogicException(sprintf('Cannot use UTF-8 route requirements without setting the "utf8" option for variable "%s" in pattern "%s".', $varName, $pattern));
181179
}
182180
if (!$useUtf8 && $needsUtf8) {
183181
throw new \LogicException(sprintf('Cannot mix UTF-8 requirement with non-UTF-8 charset for variable "%s" in pattern "%s".', $varName, $pattern));

‎src/Symfony/Component/Routing/Tests/RouteCompilerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Routing/Tests/RouteCompilerTest.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,8 @@ public function provideCompileData()
184184
}
185185

186186
/**
187-
* @group legacy
188187
* @dataProvider provideCompileImplicitUtf8Data
189-
* @expectedDeprecation Using UTF-8 route %s without setting the "utf8" option is deprecated %s.
188+
* @expectedException \LogicException
190189
*/
191190
public function testCompileImplicitUtf8Data($name, $arguments, $prefix, $regex, $variables, $tokens, $deprecationType)
192191
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.