Fix decimal values in FileSizeOptionType
authorTim Düsterhus <timwolla@googlemail.com>
Sat, 1 Jun 2013 10:35:11 +0000 (12:35 +0200)
committerTim Düsterhus <timwolla@googlemail.com>
Sat, 1 Jun 2013 10:35:11 +0000 (12:35 +0200)
wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php

index ef2f38161a6b7cebb7f75972262ad811f13f8078..c3f965364f630ca35896bcec4a14f4dc7e9c549e 100644 (file)
@@ -26,8 +26,9 @@ class FileSizeOptionType extends TextOptionType {
         */
        public function getData(Option $option, $newValue) {
                $number = StringUtil::replace(WCF::getLanguage()->get('wcf.global.thousandsSeparator'), '', $newValue);
-               $d = preg_quote(WCF::getLanguage()->get('wcf.global.decimalPoint'), '~');
-               if (!preg_match('~^(?:\d*)(?:'.$d.')?\d+~', $number, $matches)) return 0;
+               $number = StringUtil::replace(WCF::getLanguage()->get('wcf.global.decimalPoint'), '.', $number);
+               
+               if (!preg_match('~^(?:\d*)\.?\d+~', $number, $matches)) return 0;
                
                $number = $matches[0];
                if (preg_match('/[kmgt]i?b$/i', $newValue, $multiplier)) {