Skip to content

Commit 72d2856

Browse files
committed
Helpers::$unsafeNames changed to const
1 parent 6bc3a29 commit 72d2856

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Forms/Helpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Helpers
2121
{
2222
use Nette\StaticClass;
2323

24-
private static $unsafeNames = [
24+
private const UNSAFE_NAMES = [
2525
'attributes', 'children', 'elements', 'focus', 'length', 'reset', 'style', 'submit', 'onsubmit', 'form',
2626
'presenter', 'action',
2727
];
@@ -85,7 +85,7 @@ public static function generateHtmlName(string $id): string
8585
if ($count) {
8686
$name = substr_replace($name, '', strpos($name, ']'), 1) . ']';
8787
}
88-
if (is_numeric($name) || in_array($name, self::$unsafeNames, true)) {
88+
if (is_numeric($name) || in_array($name, self::UNSAFE_NAMES, true)) {
8989
$name = '_' . $name;
9090
}
9191
return $name;

0 commit comments

Comments
 (0)