From: Thomas Mueller Date: Thu, 14 Feb 2013 11:59:26 +0000 (+0100) Subject: adding prototype trim as fallback for IE8 X-Git-Tag: v5.0.0beta1~47^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e643742eb3428c6a0cf6322f09152f22d00e0502;p=nextcloud-server.git adding prototype trim as fallback for IE8 --- diff --git a/core/js/compatibility.js b/core/js/compatibility.js index 3e9178f3200..0cfeefab871 100644 --- a/core/js/compatibility.js +++ b/core/js/compatibility.js @@ -23,3 +23,10 @@ if (!Function.prototype.bind) { return fBound; }; } + +//https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/Trim +if(!String.prototype.trim) { + String.prototype.trim = function () { + return this.replace(/^\s+|\s+$/g,''); + }; +} \ No newline at end of file