mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Account for files that are in bytes
This commit is contained in:
parent
7a8e828cd5
commit
5172294dfa
@ -139,7 +139,7 @@
|
||||
<script>
|
||||
// Function to convert human-readable sizes back to bytes, for sorting
|
||||
function unhumanize(text) {
|
||||
var powers = {'k': 1, 'm': 2, 'g': 3, 't': 4};
|
||||
var powers = {'b': 0, 'k': 1, 'm': 2, 'g': 3, 't': 4};
|
||||
var regex = /(\d+(?:\.\d+)?)\s?(B|K|M|G|T)?/i;
|
||||
var res = regex.exec(text);
|
||||
if(res[2] === undefined) {
|
||||
|
Loading…
Reference in New Issue
Block a user