From: Tim Düsterhus Date: Sat, 1 Jun 2013 10:35:11 +0000 (+0200) Subject: Fix decimal values in FileSizeOptionType X-Git-Tag: 2.0.0_Beta_3~68^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d3defeb6ac6593134646447dfcb122c533472ce9;p=GitHub%2FWoltLab%2FWCF.git Fix decimal values in FileSizeOptionType --- diff --git a/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php b/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php index ef2f38161a..c3f965364f 100644 --- a/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/FileSizeOptionType.class.php @@ -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)) {