All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.enonic.xp.lib.portal.SanitizeHtmlHandler Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.lib.portal;

import com.enonic.xp.portal.owasp.HtmlSanitizer;
import com.enonic.xp.script.bean.BeanContext;
import com.enonic.xp.script.bean.ScriptBean;

public final class SanitizeHtmlHandler
    implements ScriptBean
{
    private HtmlSanitizer htmlSanitizer;

    public String sanitizeHtml( final String html )
    {
        return html == null ? null : htmlSanitizer.sanitizeHtml( html );
    }

    @Override
    public void initialize( final BeanContext context )
    {
        this.htmlSanitizer = context.getService( HtmlSanitizer.class ).get();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy