summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/js/js.js2
-rw-r--r--core/js/tests/specs/coreSpec.js7
2 files changed, 8 insertions, 1 deletions
diff --git a/core/js/js.js b/core/js/js.js
index ba831e4251d..44204f438c5 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -1682,7 +1682,7 @@ OC.Util = {
return null;
}
- var s = string.toLowerCase();
+ var s = string.toLowerCase().trim();
var bytes = null;
var bytesArray = {
diff --git a/core/js/tests/specs/coreSpec.js b/core/js/tests/specs/coreSpec.js
index faafb4797be..c9e8a60f2f1 100644
--- a/core/js/tests/specs/coreSpec.js
+++ b/core/js/tests/specs/coreSpec.js
@@ -619,6 +619,13 @@ describe('Core base tests', function() {
['B', null],
['40/0', null],
['40,30 kb', null],
+ [' 122.1 MB ', 128031130],
+ ['122.1 MB ', 128031130],
+ [' 122.1 MB ', 128031130],
+ [' 122.1 MB ', 128031130],
+ ['122.1 MB ', 128031130],
+ [' 125', 125],
+ [' 125 ', 125],
];
for (var i = 0; i < data.length; i++) {
expect(OC.Util.computerFileSize(data[i][0])).toEqual(data[i][1]);