@Test public void testSanitizeSpaces() { HtmlSanitizerService service = Framework.getService(HtmlSanitizerService.class); assertEquals("<strong>strong</strong>\n<em>content</em>", service.sanitizeString("<strong>strong</strong>\n<em>content</em>", null)); assertEquals("<p><strong>strong</strong><em>content</em></p>", service.sanitizeString("<p><strong>strong</strong><em>content</em></p>", null)); }
@Override public String sanitizeString(String string, String info) { if (policy == null) { log.error("Cannot sanitize, no policy registered"); return string; } return policy.sanitize(string); }
HtmlSanitizerServiceImpl extends DefaultComponent implements HtmlSanitizerService { @Override public String sanitizeString(String string, String info) { if (policy == null) { log.error("Cannot sanitize, no policy registered"); return string; } return policy.sanitize(string); } }
HtmlSanitizerServiceImpl extends DefaultComponent implements HtmlSanitizerService { @Override public String sanitizeString(String string, String info) { if (policy == null) { log.error("Cannot sanitize, no policy registered"); return string; } return policy.sanitize(string); }  }
HtmlSanitizerServiceImpl extends DefaultComponent implements HtmlSanitizerService { @Override public String sanitizeString(String string, String info) { if (policy == null) { log.error("Cannot sanitize, no policy registered"); return string; } return policy.sanitize(string); }  @Override void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor); @Override void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor); @Override void sanitizeDocument(DocumentModel doc); @Override String sanitizeString(String string, String info); }
HtmlSanitizerServiceImpl extends DefaultComponent implements HtmlSanitizerService { @Override public String sanitizeString(String string, String info) { if (policy == null) { log.error("Cannot sanitize, no policy registered"); return string; } return policy.sanitize(string); }  @Override void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor); @Override void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor); @Override void sanitizeDocument(DocumentModel doc); @Override String sanitizeString(String string, String info); static final String ANTISAMY_XP; static final String SANITIZER_XP; public LinkedList<HtmlSanitizerAntiSamyDescriptor> allPolicies; public PolicyFactory policy; public List<HtmlSanitizerDescriptor> allSanitizers; public List<HtmlSanitizerDescriptor> sanitizers; }