Merge pull request #17130 from nextcloud/refactor/deprecate-global-dompurify

Deprecate the global DOMPurify
This commit is contained in:
Roeland Jago Douma 2019-09-14 13:38:45 +02:00 committed by GitHub
commit 4cae5ae368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -890,7 +890,7 @@ function Oe(e){return e.toString().split("&").join("&amp;").split("<").join("&lt
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
var je=function(){void 0===window.TESTING&&console.warn.apply(console,arguments)},ze=function(e,t){var n=e,i=function(){return je("The ".concat(t," library is deprecated! It will be removed in nextcloud 19.")),n.apply(this,arguments)};return Object.assign(i,n),i},Fe=function(e,t,n){void 0!==window[e]&&delete window[e],Object.defineProperty(window,e,{get:function(){return je(n?"".concat(e," is deprecated: ").concat(n):"".concat(e," is deprecated")),t()}})};window._=d.a,window.$=l.a,window.autosize=w.a,window.Backbone=x.a,window.Clipboard=A.a,window.ClipboardJS=A.a,window.cssVars=se,window.dav=ae.a,window.DOMPurify=ce.a,window.Handlebars=de.a,window.jstimezonedetect=pe.a,window.jstz=pe.a,window.jQuery=l.a,window.marked=ze(me.a,"marked"),window.md5=_e.a,window.moment=p.a,window.OC=c.a,Fe("initCore",(function(){return y}),"this is an internal function"),Fe("oc_appswebroots",(function(){return c.a.appswebroots}),"use OC.appswebroots instead"),Fe("oc_capabilities",c.a.getCapabilities,"use OC.getCapabilities instead"),Fe("oc_config",(function(){return c.a.config}),"use OC.config instead"),Fe("oc_current_user",(function(){return c.a.getCurrentUser().uid}),"use OC.getCurrentUser().uid instead"),Fe("oc_debug",(function(){return c.a.debug}),"use OC.debug instead"),Fe("oc_defaults",(function(){return c.a.theme}),"use OC.theme instead"),Fe("oc_isadmin",c.a.isUserAdmin,"use OC.isUserAdmin() instead"),Fe("oc_requesttoken",(function(){return Object(m.a)()}),"use OC.requestToken instead"),Fe("oc_webroot",(function(){return c.a.webroot}),"use OC.getRootPath() instead"),Fe("OCDialogs",(function(){return c.a.dialogs}),"use OC.dialogs instead"),window.OCP=He,window.OCA=Pe.a,window.escapeHTML=ze(Oe,"escapeHTML"),window.formatDate=ze((function(e){return console.warn("formatDate is deprecated, use OC.Util.formatDate instead"),c.a.Util.formatDate(e)}
var je=function(){void 0===window.TESTING&&console.warn.apply(console,arguments)},ze=function(e,t){var n=e,i=function(){return je("The ".concat(t," library is deprecated! It will be removed in nextcloud 19.")),n.apply(this,arguments)};return Object.assign(i,n),i},Fe=function(e,t,n){void 0!==window[e]&&delete window[e],Object.defineProperty(window,e,{get:function(){return je(n?"".concat(e," is deprecated: ").concat(n):"".concat(e," is deprecated")),t()}})};window._=d.a,window.$=l.a,window.autosize=w.a,window.Backbone=x.a,window.Clipboard=A.a,window.ClipboardJS=A.a,window.cssVars=se,window.dav=ae.a,Fe("DOMPurify",(function(){return ce.a}),"The global DOMPurify is deprecated, ship your own"),window.Handlebars=de.a,window.jstimezonedetect=pe.a,window.jstz=pe.a,window.jQuery=l.a,window.marked=ze(me.a,"marked"),window.md5=_e.a,window.moment=p.a,window.OC=c.a,Fe("initCore",(function(){return y}),"this is an internal function"),Fe("oc_appswebroots",(function(){return c.a.appswebroots}),"use OC.appswebroots instead"),Fe("oc_capabilities",c.a.getCapabilities,"use OC.getCapabilities instead"),Fe("oc_config",(function(){return c.a.config}),"use OC.config instead"),Fe("oc_current_user",(function(){return c.a.getCurrentUser().uid}),"use OC.getCurrentUser().uid instead"),Fe("oc_debug",(function(){return c.a.debug}),"use OC.debug instead"),Fe("oc_defaults",(function(){return c.a.theme}),"use OC.theme instead"),Fe("oc_isadmin",c.a.isUserAdmin,"use OC.isUserAdmin() instead"),Fe("oc_requesttoken",(function(){return Object(m.a)()}),"use OC.requestToken instead"),Fe("oc_webroot",(function(){return c.a.webroot}),"use OC.getRootPath() instead"),Fe("OCDialogs",(function(){return c.a.dialogs}),"use OC.dialogs instead"),window.OCP=He,window.OCA=Pe.a,window.escapeHTML=ze(Oe,"escapeHTML"),window.formatDate=ze((function(e){return console.warn("formatDate is deprecated, use OC.Util.formatDate instead"),c.a.Util.formatDate(e)}
/*
* @copyright 2019 Christoph Wurst <christoph@winzerhof-wurst.at>
*

File diff suppressed because one or more lines are too long

View File

@ -107,7 +107,7 @@ window['Clipboard'] = ClipboardJS
window['ClipboardJS'] = ClipboardJS
window['cssVars'] = cssVars
window['dav'] = dav
window['DOMPurify'] = DOMPurify
setDeprecatedProp('DOMPurify', () => DOMPurify, 'The global DOMPurify is deprecated, ship your own')
window['Handlebars'] = Handlebars
window['jstimezonedetect'] = jstimezonedetect
window['jstz'] = jstimezonedetect