From 12c3ab559fafd67aeaf55f263ce7b2193c68ac12 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Tue, 15 Apr 2008 09:21:45 +0000 Subject: [PATCH] Merged revisions 32182 via svnmerge from svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.0-nzct ........ r32182 | ischommer | 2007-03-14 23:34:50 +1300 (Wed, 14 Mar 2007) | 1 line More versatile character-replacing for css-classes ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@52775 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- forms/OptionsetField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms/OptionsetField.php b/forms/OptionsetField.php index 5f25bb7fc..9f8033a5f 100755 --- a/forms/OptionsetField.php +++ b/forms/OptionsetField.php @@ -44,7 +44,7 @@ class OptionsetField extends DropdownField { $odd = ($odd + 1) % 2; $extraClass = $odd ? "odd" : "even"; - $extraClass .= " val" . str_replace(' ','',$key); + $extraClass .= " val" . preg_replace('/[^a-zA-Z0-9\-\_]/','_', $key); $disabled = $this->disabled ? 'disabled="disabled"' : ''; $options .= "
  • name\" type=\"radio\" value=\"$key\"$checked $disabled/>
  • \n";