Merge pull request #10663 from lekoala/patch-33

FIX Prevent backslash in CSS class name
This commit is contained in:
Michal Kleiner 2023-01-30 22:51:09 +13:00 committed by GitHub
commit 20e4aae25b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -207,7 +207,7 @@ class PermissionCheckboxSetField extends FormField
$odd = ($odd + 1) % 2; $odd = ($odd + 1) % 2;
$extraClass = $odd ? 'odd' : 'even'; $extraClass = $odd ? 'odd' : 'even';
$extraClass .= ' val' . str_replace(' ', '', $code ?? ''); $extraClass .= ' val' . str_replace([' ', '\\'], ['', '-'], $code ?? '');
$itemID = $this->ID() . '_' . preg_replace('/[^a-zA-Z0-9]+/', '', $code ?? ''); $itemID = $this->ID() . '_' . preg_replace('/[^a-zA-Z0-9]+/', '', $code ?? '');
$disabled = $inheritMessage = ''; $disabled = $inheritMessage = '';
$checked = (isset($uninheritedCodes[$code]) || isset($inheritedCodes[$code])) $checked = (isset($uninheritedCodes[$code]) || isset($inheritedCodes[$code]))