0 && ($upload_max < $max_size || $max_size == 0)) { $max_size = $upload_max; } } if (!$unitOutput) { // return numerical max size return $max_size; } // format max size return JHtml::fetch('number.bytes', $max_size, 'auto', 0); } /** * Returns the size in bytes without the unit for the comparison. * * @param string $size The size which is received from the PHP settings. * * @return float The size in bytes without the unit. */ private static function parseSize($size) { // extract the size unit $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // take only the size numbers $size = preg_replace('/[^0-9\.]/', '', $size); $return = round($size); if ($unit) { // calculate the correct size according to the specified unit $return = round($size * pow(1024, stripos('bkmgtpezy', $unit[0]))); } return $return; } }