8000 Merge branch '4.3' into 4.4 · symfony/symfony@12f00e3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 12f00e3

Browse files
Merge branch '4.3' into 4.4
* 4.3: allow button names to start with uppercase letter
2 parents bf8e444 + a7c66db commit 12f00e3

File tree

5 files changed

+4
-12
lines changed

5 files changed

+4
-12
lines changed

UPGRADE-4.3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Form
9696
----
9797

9898
* Using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled is deprecated.
99-
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated and will lead to an
99+
* Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated and will lead to an
100100
exception in 5.0.
101101
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and
102102
will lead to an exception in 5.0.

UPGRADE-5.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Form
142142
without configuring a reference date.
143143
* Removed support for using `int` or `float` as data for the `NumberType` when the `input` option is set to `string`.
144144
* Removed support for using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled.
145-
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore leads to an exception.
145+
* Using names for buttons that do not start with a letter, a digit, or an underscore leads to an exception.
146146
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons leads to an
147147
exception.
148148
* Using the `date_format`, `date_widget`, and `time_widget` options of the `DateTimeType` when the `widget` option is

src/Symfony/Component/Form/ButtonBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function __construct(?string $name, array $options = [])
6161
$this->name = $name;
6262
$this->options = $options;
6363

64-
if (preg_match('/^([^a-z0-9_].*)?(.*[^a-zA-Z0-9_\-:].*)?$/D', $name, $matches)) {
64+
if (preg_match('/^([^a-zA-Z0-9_].*)?(.*[^a-zA-Z0-9_\-:].*)?$/D', $name, $matches)) {
6565
if (isset($matches[1])) {
6666
@trigger_error(sprintf('Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated since Symfony 4.3 and will throw an exception in 5.0 ("%s" given).', $name), E_USER_DEPRECATED);
6767
}

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ CHANGELOG
2020

2121
* added a `symbol` option to the `PercentType` that allows to disable or customize the output of the percent character
2222
* Using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled is deprecated.
23-
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated and will lead to an
23+
* Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated and will lead to an
2424
exception in 5.0.
2525
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and
2626
will lead to an exception in 5.0.

src/Symfony/Component/Form/Tests/ButtonBuilderTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ public function testNameContainingIllegalCharacters()
4747
$this->assertInstanceOf('\Symfony\Component\Form\ButtonBuilder', new ButtonBuilder('button[]'));
4848
}
4949

50-
/**
51-
* @group legacy
52-
*/
53-
public function testNameStartingWithIllegalCharacters()
54-
{
55-
$this->assertInstanceOf('\Symfony\Component\Form\ButtonBuilder', new ButtonBuilder('Button'));
56-
}
57-
5850
public function getInvalidNames()
5951
{
6052
return [

0 commit comments

Comments
 (0)
0