diff --git a/core/js/share.js b/core/js/share.js index f767da18da0ac528b76133307b8ee45e87e7504d..99fd08c6411aa76fd4412bcdfdcb9c90104af6f2 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -827,6 +827,10 @@ OC.Share={ */ _parseTime: function(time) { if (_.isString(time)) { + // skip empty strings and hex values + if (time === '' || (time.length > 1 && time[0] === '0' && time[1] === 'x')) { + return null; + } time = parseInt(time, 10); if(isNaN(time)) { time = null; diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js index a8beb807ccc3608bb10b3a07b232bb8cf3a46f61..3dc25134f59cd23ee14437a6a868cffa2f78f864 100644 --- a/core/js/tests/specs/shareSpec.js +++ b/core/js/tests/specs/shareSpec.js @@ -1324,6 +1324,8 @@ describe('OC.Share tests', function() { [ 123456 , 123456], ['0123456', 123456], ['abcdefg', null], + ['0x12345', null], + [ '', null], ], function(value) { expect(OC.Share._parseTime(value[0])).toEqual(value[1]); });