From: Jan Schneider Date: Wed, 23 Dec 2009 14:15:56 +0000 (+0100) Subject: Moved from DIMP. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b537f8d9c1c4a43610aab72eb04353cc20b9a044;p=horde.git Moved from DIMP. --- diff --git a/horde/js/horde.js b/horde/js/horde.js index 77c868171..a06fac352 100644 --- a/horde/js/horde.js +++ b/horde/js/horde.js @@ -75,6 +75,17 @@ Object.extend(String.prototype, { window[func[1]] = eval(func[1]); } }); + }, + + /* More efficient String.unfilterJSON() function. */ + unfilterJSON: function(filter) { + if (filter) { + return this.replace(filter, '$1'); + } else if (this.startsWith('/*-secure-') && + this.endsWith('*/')) { + return this.slice(10, -2); + } + return this; } });