Fixed user option creation
authorMarcel Werk <burntime@woltlab.com>
Tue, 11 Jun 2013 21:01:19 +0000 (23:01 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 11 Jun 2013 21:01:19 +0000 (23:01 +0200)
wcfsetup/install/files/lib/acp/form/UserOptionAddForm.class.php

index 91001f8d9d0e7b615824d196a712b8fee95ec49d..a7ea45d61197baee8455a332fa2741ddb6346665 100644 (file)
@@ -170,6 +170,13 @@ class UserOptionAddForm extends AbstractForm {
                if (isset($_POST['searchable'])) $this->searchable = intval($_POST['searchable']);
                if (isset($_POST['showOrder'])) $this->showOrder = intval($_POST['showOrder']);
                if (isset($_POST['outputClass'])) $this->outputClass = StringUtil::trim($_POST['outputClass']);
+               
+               if ($this->optionType == 'boolean' || $this->optionType == 'integer') {
+                       $this->defaultValue = intval($this->defaultValue);
+               }
+               if ($this->optionType == 'float') {
+                       $this->defaultValue = floatval($this->defaultValue);
+               }
        }
        
        /**